This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

我这if else语句有问题吗?

if(a==0)
{
    a=1;


    GAP_UpdateAdvertisingData(simpleBLEPeripheral_TaskID,
    TRUE,
    sizeof(advertData),
     advertData ); //原广播数据
}
else
{
     a=0;

     GAP_UpdateAdvertisingData(simpleBLEPeripheral_TaskID,
     TRUE,
     sizeof(advertData_Update),
     advertData_Update ); //更新广播数据
}

//

仿真发现,if执行,然后else也执行,下一次else执行,依次循环,结果观察,广播只有else里边的数据,广播一秒,停一秒,

大佬帮我看看,是不是我失忆了。