//uint8_t receive_data[]={7,0,0,0,0,0,0,0};//放在这一行(或别的行)就能正常运行else if(recreceive_data[0]==7)这分支程序,说明recreceive_data[0]的初始值是7!
uint8_t rebufer[7] = {0,0,0,0,0,0,0,0};
uint8_t receive_data[]={7,0,0,0,0,0,0,0};//放在这一行就不行,不行运行main函数中else if(recreceive_data[0]==7)这分支程序,通过调试发现receive_data[0]的初始值是0,而不是7,不知为什么?
......
int main(void)
{
while (1)
{
if(receive_data[0]==5)
{
...
}
else if(receive_data[0]==7)
{
...
}
}
}
代码不是很大,编译的代码大小如下:
Program Size: Code=13880 RO-data=268 RW-data=1252 ZI-data=1636
芯片是STM32F101C8T6
以上问题有哪位大侠遇到吗?一直想不通是怎么回事,哪里有问题呢? |