#include "suspend.h"
#include "matrix.h"
#include "action.h"
+#include "backlight.h"
void suspend_power_down(void)
{
+#ifdef BACKLIGHT_ENABLE
+ backlight_set(0);
+#endif
#ifndef NO_SUSPEND_POWER_DOWN
// Enable watchdog to wake from MCU sleep
cli();
return false;
}
+// run immediately after wakeup
void suspend_wakeup_init(void)
{
- matrix_init();
+ // clear keyboard state
clear_keyboard();
+#ifdef BACKLIGHT_ENABLE
+ backlight_init();
+#endif
+}
+
+#ifndef NO_SUSPEND_POWER_DOWN
+/* watchdog timeout */
+ISR(WDT_vect)
+{
+ /* wakeup from MCU sleep mode */
+/*
+ // blink LED
+ static uint8_t led_state = 0;
+ static uint8_t led_count = 0;
+ led_count++;
+ if ((led_count & 0x07) == 0) {
+ led_set((led_state ^= (1<<USB_LED_CAPS_LOCK)));
+ }
+*/
}
+#endif