MCPcopy Create free account
hub / github.com/arkhipenko/TaskScheduler / SleepMethod

Function SleepMethod

src/TaskSchedulerSleepMethods.h:77–85  ·  view source on GitHub ↗

* @brief AVR-specific sleep method implementation using IDLE sleep mode * * This implementation uses the AVR's IDLE sleep mode which stops the CPU * but keeps all peripherals running. This allows timers to continue operating * and wake up the processor when needed. The sleep duration parameter is * ignored as the wake-up is controlled by timer interrupts. * * @param aDuration Duration param

Source from the content-addressed store, hash-verified

75 * - ATmega32U4: ~20mA active → ~8mA idle (60% power reduction)
76 */
77void SleepMethod( unsigned long aDuration ) {
78 set_sleep_mode(SLEEP_MODE_IDLE);
79 sleep_enable();
80 /* Now enter sleep mode. */
81 sleep_mode();
82
83 /* The program will continue from here after the timer timeout ~1 ms */
84 sleep_disable(); /* First thing to do is disable sleep. */
85}
86// ARDUINO_ARCH_AVR
87
88

Callers

nothing calls this directly

Calls 1

delayFunction · 0.85

Tested by

no test coverage detected