BSP_ENTER_CRITICAL_SECTION(intState);
BSP_EXIT_CRITICAL_SECTION(intState);
两条语句主要作用是开、关中断,但不明白在程序里起到了什么作用。我用例程跑时,把这两句注释掉也能正常运行!请专家不吝赐教\(^o^)/~
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.
在这两句之间 一般有全局变量 或有 与中断中的变量共用的变量,这是一个标准的互斥操作,实现变量原子操作