From afc3148e2341e4be982cdb628543e30923cfdaf7 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 26 Mar 2013 16:55:45 +0900 Subject: Add supsend and wakeup to pjrc stack --- common/suspend.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'common') diff --git a/common/suspend.c b/common/suspend.c index 397e0729a6..6029fe7ffa 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<