If I use disable interrupt and enable interrupt parcel wait Forinterrupt (WFI). Do you think WFI can still be awakened? Have you ever thought about it.
Took Stm8l151k4 's development board last night and actually tested it down. This usage is absolutely no problem. So I guess inside the chip, the core should be dedicated to a signal line to wake up the sleep state of the core, this signal is not affected by interrupt disable.
This experiment is useful for controlling sleep wake Sleep/resume, because you will expect sleep wake Sleep/resume to follow a single thread, otherwise you will not have the opportunity to intercept the resume process, because the core will run out of long-awaited WFI instructions when you resume. Then you jump to the interrupt ISR, and you don't have a chance to intercept it at all. This leads to the absence of a unified entry and exit for the Sleep/resume, and the necessary recovery work to be done when it wakes up.
This experiment will be extended to the halt directive. Lay the groundwork for the next power optimization.