CMSIS-RTOS2  Version 2.0.0
Real-Time Operating System: API and RTX Reference Implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Low-Power Operation

The system thread os_IdleThread can be use to switch the system into a low-power mode. The easiest form to enter a low-power mode is the execution of the __WFE function that puts the processor into a sleep mode where it waits for an event.

Configuration Example:

#include "RTE_Components.h"
#include CMSIS_device_header /* Device definitions */
void os_IdleThread (void) {
/* The idle demon is a system thread, running when no other thread is */
/* ready to run. */
for (;;) {
__WFE(); /* Enter sleep mode */
}
}
Note
__WFE() is not available at every Cortex-M implementation. Check device manuals for availability.