summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-03-26 08:55:45 +0100
committertmk <nobody@nowhere>2013-03-27 07:18:08 +0100
commitafc3148e2341e4be982cdb628543e30923cfdaf7 (patch)
tree523679724e32be013ba461a779c088912c5a72f8 /common
parent2c0bb5e7e620b0472f110d2cbc5768bb6d97eec5 (diff)
downloadqmk_firmware-afc3148e2341e4be982cdb628543e30923cfdaf7.tar.gz
qmk_firmware-afc3148e2341e4be982cdb628543e30923cfdaf7.tar.xz
Add supsend and wakeup to pjrc stack
Diffstat (limited to 'common')
-rw-r--r--common/suspend.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/suspend.c b/common/suspend.c
index 397e0729a..6029fe7ff 100644
--- a/common/suspend.c
+++ b/common/suspend.c
@@ -44,8 +44,27 @@ bool suspend_wakeup_condition(void)
return false;
}
+// run immediately after wakeup
void suspend_wakeup_init(void)
{
+ // clear matrix and keyboard state
matrix_init();
clear_keyboard();
}
+
+#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