aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/avr/suspend.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/avr/suspend.c')
-rw-r--r--tmk_core/common/avr/suspend.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index af99f52b5..22c402b02 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -8,6 +8,7 @@
8#include "suspend_avr.h" 8#include "suspend_avr.h"
9#include "suspend.h" 9#include "suspend.h"
10#include "timer.h" 10#include "timer.h"
11#include "led.h"
11#ifdef PROTOCOL_LUFA 12#ifdef PROTOCOL_LUFA
12#include "lufa.h" 13#include "lufa.h"
13#endif 14#endif
@@ -64,6 +65,12 @@ static void power_down(uint8_t wdto)
64 // Watchdog Interrupt Mode 65 // Watchdog Interrupt Mode
65 wdt_intr_enable(wdto); 66 wdt_intr_enable(wdto);
66 67
68#ifdef BACKLIGHT_ENABLE
69backlight_set(0);
70#endif
71
72 led_off();
73
67 // TODO: more power saving 74 // TODO: more power saving
68 // See PicoPower application note 75 // See PicoPower application note
69 // - I/O port input with pullup 76 // - I/O port input with pullup
@@ -89,6 +96,9 @@ __attribute__ ((weak)) void matrix_power_up(void) {}
89__attribute__ ((weak)) void matrix_power_down(void) {} 96__attribute__ ((weak)) void matrix_power_down(void) {}
90bool suspend_wakeup_condition(void) 97bool suspend_wakeup_condition(void)
91{ 98{
99#ifdef BACKLIGHT_ENABLE
100 backlight_set(0);
101#endif
92 matrix_power_up(); 102 matrix_power_up();
93 matrix_scan(); 103 matrix_scan();
94 matrix_power_down(); 104 matrix_power_down();
@@ -104,8 +114,10 @@ void suspend_wakeup_init(void)
104 // clear keyboard state 114 // clear keyboard state
105 clear_keyboard(); 115 clear_keyboard();
106#ifdef BACKLIGHT_ENABLE 116#ifdef BACKLIGHT_ENABLE
117 backlight_set(0);
107 backlight_init(); 118 backlight_init();
108#endif 119#endif
120led_set(host_keyboard_leds());
109} 121}
110 122
111#ifndef NO_SUSPEND_POWER_DOWN 123#ifndef NO_SUSPEND_POWER_DOWN
@@ -122,3 +134,4 @@ ISR(WDT_vect)
122 } 134 }
123} 135}
124#endif 136#endif
137