diff options
| author | Wilba6582 <Jason.S.Williams@gmail.com> | 2016-11-23 16:22:57 +1100 |
|---|---|---|
| committer | Wilba6582 <Jason.S.Williams@gmail.com> | 2016-11-23 16:22:57 +1100 |
| commit | 5893f0fa1fcecfface25ce570f37e51031a14489 (patch) | |
| tree | df65dfe3837316a4ebce523c87ce2864789adcef /tmk_core | |
| parent | 2b3a3ca67867ecd02e100c6e2fbe1972af1abb84 (diff) | |
| download | qmk_firmware-5893f0fa1fcecfface25ce570f37e51031a14489.tar.gz qmk_firmware-5893f0fa1fcecfface25ce570f37e51031a14489.zip | |
Fixed NO_SUSPEND_POWER_DOWN handling
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/avr/suspend.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 8a7272bbc..939bda15e 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c | |||
| @@ -47,6 +47,7 @@ void suspend_idle(uint8_t time) | |||
| 47 | sleep_disable(); | 47 | sleep_disable(); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | #ifndef NO_SUSPEND_POWER_DOWN | ||
| 50 | /* Power down MCU with watchdog timer | 51 | /* Power down MCU with watchdog timer |
| 51 | * wdto: watchdog timer timeout defined in <avr/wdt.h> | 52 | * wdto: watchdog timer timeout defined in <avr/wdt.h> |
| 52 | * WDTO_15MS | 53 | * WDTO_15MS |
| @@ -61,6 +62,7 @@ void suspend_idle(uint8_t time) | |||
| 61 | * WDTO_8S | 62 | * WDTO_8S |
| 62 | */ | 63 | */ |
| 63 | static uint8_t wdt_timeout = 0; | 64 | static uint8_t wdt_timeout = 0; |
| 65 | |||
| 64 | static void power_down(uint8_t wdto) | 66 | static void power_down(uint8_t wdto) |
| 65 | { | 67 | { |
| 66 | #ifdef PROTOCOL_LUFA | 68 | #ifdef PROTOCOL_LUFA |
| @@ -98,10 +100,13 @@ static void power_down(uint8_t wdto) | |||
| 98 | // Disable watchdog after sleep | 100 | // Disable watchdog after sleep |
| 99 | wdt_disable(); | 101 | wdt_disable(); |
| 100 | } | 102 | } |
| 103 | #endif | ||
| 101 | 104 | ||
| 102 | void suspend_power_down(void) | 105 | void suspend_power_down(void) |
| 103 | { | 106 | { |
| 107 | #ifndef NO_SUSPEND_POWER_DOWN | ||
| 104 | power_down(WDTO_15MS); | 108 | power_down(WDTO_15MS); |
| 109 | #endif | ||
| 105 | } | 110 | } |
| 106 | 111 | ||
| 107 | __attribute__ ((weak)) void matrix_power_up(void) {} | 112 | __attribute__ ((weak)) void matrix_power_up(void) {} |
| @@ -109,8 +114,10 @@ __attribute__ ((weak)) void matrix_power_down(void) {} | |||
| 109 | bool suspend_wakeup_condition(void) | 114 | bool suspend_wakeup_condition(void) |
| 110 | { | 115 | { |
| 111 | #ifdef BACKLIGHT_ENABLE | 116 | #ifdef BACKLIGHT_ENABLE |
| 117 | #ifndef NO_SUSPEND_POWER_DOWN | ||
| 112 | backlight_set(0); | 118 | backlight_set(0); |
| 113 | #endif | 119 | #endif |
| 120 | #endif | ||
| 114 | matrix_power_up(); | 121 | matrix_power_up(); |
| 115 | matrix_scan(); | 122 | matrix_scan(); |
| 116 | matrix_power_down(); | 123 | matrix_power_down(); |
| @@ -126,7 +133,6 @@ void suspend_wakeup_init(void) | |||
| 126 | // clear keyboard state | 133 | // clear keyboard state |
| 127 | clear_keyboard(); | 134 | clear_keyboard(); |
| 128 | #ifdef BACKLIGHT_ENABLE | 135 | #ifdef BACKLIGHT_ENABLE |
| 129 | backlight_set(0); | ||
| 130 | backlight_init(); | 136 | backlight_init(); |
| 131 | #endif | 137 | #endif |
| 132 | led_set(host_keyboard_leds()); | 138 | led_set(host_keyboard_leds()); |
