進入低功耗模式的兩個指令,這是ARM里CMSIS內(nèi)核中的指令。詳情請參考鏈接里大神們的討論鏈接http://www.wowotech.net/armv8a_arch/wfe_wfi.html
cmsis_arm.cc里有如下說明
/**
brief Wait For Interrupt
details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
*/
#define __WFI __wfi
/**
brief Wait For Event
details Wait For Event is a hint instruction that permits the processor to enter
a low-power state until one of a number of events occurs.
*/
#define __WFE __wfe
什么意思呢?簡單的說:
WFI進入則可由任意中斷喚醒
WFE進入則由事件喚醒
WFI = wait for interrupt 等待中斷,即下一次中斷發(fā)生前都在此hold住不干活
WFE = wait for event 等待事件,即下一次事件發(fā)生前都在此hold住不干活
執(zhí)行這兩條語句后CPU功耗會降低,通常用這兩條語句來省電。