2 #include <util/delay.h>
4 #include <avr/interrupt.h>
23 set_sleep_mode(SLEEP_MODE_IDLE);
26 static void hw_suspend()
42 set_sleep_mode(SLEEP_MODE_PWR_DOWN);
52 // allow wakeup by long button-press only
53 } while (!buttons_wait_for_release());
55 // ok, so I will wake up
63 power_usi_disable(); // Once for lifetime
64 ACSRA |= _BV(ACD); // disable analog comparator
76 set_sleep_mode(SLEEP_MODE_IDLE);
77 } else if (adc_is_on) {
78 set_sleep_mode(SLEEP_MODE_ADC);
80 set_sleep_mode(SLEEP_MODE_PWR_DOWN);
84 // keep BOD active, no sleep_bod_disable();