A bug in wlan_station example when using GCC optimization
时间:10-02
整理:3721RD
点击:
The example defined a global variable "g_ulStatus" to set network event flags in simplelink task and the user task will check this flag to know if events happened. while a volatile keyword is missing which will cause the flag set/check failed, and the example cannot run with expected result. Please fix this issue, thanks!
volatile unsigned long g_ulStatus = 0;//SimpleLink Status
Very Good。对于不停变化,又在程序中不去改变,只作为读取操作的变量,如果不设置为volatile必然会被系统优化掉。。。除非你的编译器没有开启优化功能。