经常看到系统睡眠之前会关闭中断,那关闭中断后怎么还能被中断唤醒。 比如下面代码 { uint8 interruptState; interruptState = CyEnterCriticalSection(); /* CM0 enters Sleep mode upon execution of WFI */ CY_PM_CM0_SCR_REG &= (uint32) (~CY_PM_CM0_SCR_SLEEPDEEP); /* Sleep and wait for interrupt */ CY_PM_WFI; CyExitCriticalSection(interruptState); } CyEnterCriticalSection: MRS r0, PRIMASK ; Save and return interrupt state CPSID I ; Disable interrupts BX lr 在关闭中断后,怎么中断还能使用呢? |
有各种唤醒条件呀。 |