
To permit deep sleep, you must suspend input (permanently or temporarily). However, if platform.stdio-buffered-serial is set to true, then UARTSerial installs an interrupt handler to receive serial data for stdin.

To ensure correct operation of your application, sleep manager may disable deep sleep, in which case your board enters normal sleep, instead.

Although standard sleep doesn't affect application execution, deep sleep might introduce some additional power savings that can affect the application, for instance high-speed clock-dependent drivers. The sleep manager provides an API and logic to control device sleep mode selection. Peripherals that do not rely on high-speed clocks include the LowPowerTicker, RTC and InterruptIn APIs. Because of this, you can only enter this mode when peripherals relying on high-speed clocks are not in use. It saves additional power by turning off the high-speed clocks. This mode is similar to sleep but saves more power and has a longer wakeup time. You can wake up the processor by any internal peripheral interrupt or external pin interrupt. This mode maintains the processor, peripheral and memory state, and the peripherals continue to work and can generate interrupts. This eliminates dynamic power that the processor, memory systems and buses use. The system clock to the core stops until a reset or an interrupt occurs.

That is when all your threads are in a waiting state, for example waiting for an event or a timeout. Mbed OS enters sleep mode automatically any time the system is idle. Note: In most cases, you don't need to call sleep() directly. This function invokes sleep manager, which selects the most appropriate sleep mode. There is only one sleep function in Mbed OS: void sleep() Power management (sleep) Power management (sleep) Sleep
