11 #ifndef __SLEEP_HEADER
12 #define __SLEEP_HEADER
15 #include <avr/sleep.h>
22 void sleep(uint8_t
const & interrupt_channel, uint8_t
const & state = LOW) {
23 uint8_t adcsra_save = ADCSRA;
24 uint8_t prr_save = PRR;
26 attachInterrupt(interrupt_channel,
wake_up, state);
32 set_sleep_mode (SLEEP_MODE_PWR_DOWN);
36 MCUCR = _BV (BODS) | _BV (BODSE);
46 detachInterrupt(interrupt_channel);
50 #endif //__SLEEP_HEADER
void wake_up()
Definition: sleep.hpp:18
void sleep(uint8_t const &interrupt_channel, uint8_t const &state=LOW)
Definition: sleep.hpp:22