diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-04-28 19:39:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-29 12:39:54 +1000 |
| commit | d8167779cdfb243cb140782210d2cc6a7cb9b123 (patch) | |
| tree | 52a05a41568f5dbb0d3ba931c0d401ad03504410 /tmk_core | |
| parent | 7409f03cbf7a863e0c2c949de2a5a276f5661c04 (diff) | |
| download | qmk_firmware-d8167779cdfb243cb140782210d2cc6a7cb9b123.tar.gz qmk_firmware-d8167779cdfb243cb140782210d2cc6a7cb9b123.zip | |
Change RGB/LED Matrix to use a simple define for USB suspend (#12697)
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/avr/suspend.c | 7 | ||||
| -rw-r--r-- | tmk_core/common/chibios/suspend.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 96b19a77f..1c2bf9cb4 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c | |||
| @@ -163,6 +163,10 @@ void suspend_power_down(void) { | |||
| 163 | rgblight_suspend(); | 163 | rgblight_suspend(); |
| 164 | # endif | 164 | # endif |
| 165 | 165 | ||
| 166 | # if defined(RGB_MATRIX_ENABLE) | ||
| 167 | rgb_matrix_set_suspend_state(true); | ||
| 168 | # endif | ||
| 169 | |||
| 166 | // Enter sleep state if possible (ie, the MCU has a watchdog timeout interrupt) | 170 | // Enter sleep state if possible (ie, the MCU has a watchdog timeout interrupt) |
| 167 | # if defined(WDT_vect) | 171 | # if defined(WDT_vect) |
| 168 | power_down(WDTO_15MS); | 172 | power_down(WDTO_15MS); |
| @@ -214,6 +218,9 @@ void suspend_wakeup_init(void) { | |||
| 214 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 218 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 215 | rgblight_wakeup(); | 219 | rgblight_wakeup(); |
| 216 | #endif | 220 | #endif |
| 221 | # if defined(RGB_MATRIX_ENABLE) | ||
| 222 | rgb_matrix_set_suspend_state(false); | ||
| 223 | # endif | ||
| 217 | 224 | ||
| 218 | suspend_wakeup_init_kb(); | 225 | suspend_wakeup_init_kb(); |
| 219 | } | 226 | } |
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index b3949185e..1f4f93c45 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c | |||
| @@ -83,6 +83,9 @@ void suspend_power_down(void) { | |||
| 83 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 83 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 84 | rgblight_suspend(); | 84 | rgblight_suspend(); |
| 85 | #endif | 85 | #endif |
| 86 | # if defined(RGB_MATRIX_ENABLE) | ||
| 87 | rgb_matrix_set_suspend_state(true); | ||
| 88 | # endif | ||
| 86 | #ifdef AUDIO_ENABLE | 89 | #ifdef AUDIO_ENABLE |
| 87 | stop_all_notes(); | 90 | stop_all_notes(); |
| 88 | #endif /* AUDIO_ENABLE */ | 91 | #endif /* AUDIO_ENABLE */ |
| @@ -151,5 +154,8 @@ void suspend_wakeup_init(void) { | |||
| 151 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 154 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 152 | rgblight_wakeup(); | 155 | rgblight_wakeup(); |
| 153 | #endif | 156 | #endif |
| 157 | # if defined(RGB_MATRIX_ENABLE) | ||
| 158 | rgb_matrix_set_suspend_state(false); | ||
| 159 | # endif | ||
| 154 | suspend_wakeup_init_kb(); | 160 | suspend_wakeup_init_kb(); |
| 155 | } | 161 | } |
