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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 47a82a2ee..690d7f38c 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -28,6 +28,13 @@
28# include "rgblight.h" 28# include "rgblight.h"
29#endif 29#endif
30 30
31#ifdef LED_MATRIX_ENABLE
32# include "led_matrix.h"
33#endif
34#ifdef RGB_MATRIX_ENABLE
35# include "rgb_matrix.h"
36#endif
37
31/** \brief Suspend idle 38/** \brief Suspend idle
32 * 39 *
33 * FIXME: needs doc 40 * FIXME: needs doc
@@ -156,6 +163,13 @@ void suspend_power_down(void) {
156 rgblight_suspend(); 163 rgblight_suspend();
157# endif 164# endif
158 165
166# if defined(LED_MATRIX_ENABLE)
167 led_matrix_set_suspend_state(true);
168# endif
169# if defined(RGB_MATRIX_ENABLE)
170 rgb_matrix_set_suspend_state(true);
171# endif
172
159 // Enter sleep state if possible (ie, the MCU has a watchdog timeout interrupt) 173 // Enter sleep state if possible (ie, the MCU has a watchdog timeout interrupt)
160# if defined(WDT_vect) 174# if defined(WDT_vect)
161 power_down(WDTO_15MS); 175 power_down(WDTO_15MS);
@@ -208,6 +222,13 @@ void suspend_wakeup_init(void) {
208 rgblight_wakeup(); 222 rgblight_wakeup();
209#endif 223#endif
210 224
225#if defined(LED_MATRIX_ENABLE)
226 led_matrix_set_suspend_state(false);
227#endif
228#if defined(RGB_MATRIX_ENABLE)
229 rgb_matrix_set_suspend_state(false);
230#endif
231
211 suspend_wakeup_init_kb(); 232 suspend_wakeup_init_kb();
212} 233}
213 234