To fix the error, you can declare the "ack" variable as a static variable within the function like this:

void tuner_write_WB(U8 tuner_command, U8 tuner_length)
{
    U8 length = 0;
    static bit ack;
}

By declaring it as static, the variable will retain its value between function calls and can be used in subsequent calls without being re-initialized.

void tuner_write_WBU8 tuner_command U8 tuner_length	U8	length = 0;	bit ack;bit ack;报错位变量必须是全局的或静态

原文地址: https://www.cveoy.top/t/topic/i6Kx 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录