6 void suspend_power_down(void)
8 #ifndef NO_SUSPEND_POWER_DOWN
9 // Enable watchdog to wake from MCU sleep
13 // Watchdog Interrupt and System Reset Mode
14 //wdt_enable(WDTO_1S);
15 //WDTCSR |= _BV(WDIE);
17 // Watchdog Interrupt Mode
18 wdt_intr_enable(WDTO_120MS);
20 // TODO: more power saving
21 // See PicoPower application note
22 // - I/O port input with pullup
25 // - Power Reduction Register PRR
26 // sleep in power down mode
27 set_sleep_mode(SLEEP_MODE_PWR_DOWN);
33 // Disable watchdog after sleep
38 bool suspend_wakeup_condition(void)
41 for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
42 if (matrix_get_row(r)) return true;
47 void suspend_wakeup_init(void)