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.
工具与软件:
HII
在编写任何代码时,是否需要编写_WFI()函数?
我应该这样写吗?
只有当您要暂停主线程 并让 中断完成所有工作时,才需要使用_WFI()。
您的代码最安全、因为 IRQ 处理程序可以快速进入和退出。 请注意、"标志"应为易失性。 但是、如果中断之间有很多时间、那么最好在处理程序中调用 transmit_msg()。
WFI 或 WFE 函数会等待中断/事件、就像 Keith 说的那样、它将暂停主线程、并将 CPU 置于您设置的低功耗模式。
此致、
Luke