summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2021-01-11 03:07:09 -0500
committerGitHub <noreply@github.com>2021-01-11 00:07:09 -0800
commit4d96b85b6f39e89bdcc74853958f91153f27bfc1 (patch)
tree55bec712ab1e48867c68809aed89988e0d7c5a8f /tmk_core
parentd877f40b7076ed1594aef61aff7940793b896403 (diff)
downloadqmk_firmware-4d96b85b6f39e89bdcc74853958f91153f27bfc1.tar.gz
qmk_firmware-4d96b85b6f39e89bdcc74853958f91153f27bfc1.zip
Lighting Layers should be disabled when suspended (#11442)
* Lighting Layers should be disabled when suspended * bugfixes
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/avr/suspend.c16
-rw-r--r--tmk_core/common/chibios/suspend.c16
2 files changed, 4 insertions, 28 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index aa0d42680a..86c3df040a 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -24,9 +24,6 @@
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
# include "rgblight.h"
-extern rgblight_config_t rgblight_config;
-static bool rgblight_enabled;
-static bool is_suspended;
#endif
/** \brief Suspend idle
@@ -104,12 +101,7 @@ static void power_down(uint8_t wdto) {
// stop_all_notes();
# endif /* AUDIO_ENABLE */
# if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
- rgblight_timer_disable();
- if (!is_suspended) {
- is_suspended = true;
- rgblight_enabled = rgblight_config.enable;
- rgblight_disable_noeeprom();
- }
+ rgblight_suspend();
# endif
suspend_power_down_kb();
@@ -177,11 +169,7 @@ void suspend_wakeup_init(void) {
#endif
led_set(host_keyboard_leds());
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
- is_suspended = false;
- if (rgblight_enabled) {
- rgblight_enable_noeeprom();
- }
- rgblight_timer_enable();
+ rgblight_wakeup();
#endif
suspend_wakeup_init_kb();
}
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c
index 24efb0ac4c..796056019f 100644
--- a/tmk_core/common/chibios/suspend.c
+++ b/tmk_core/common/chibios/suspend.c
@@ -18,9 +18,6 @@
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
# include "rgblight.h"
-extern rgblight_config_t rgblight_config;
-static bool rgblight_enabled;
-static bool is_suspended;
#endif
/** \brief suspend idle
@@ -66,12 +63,7 @@ void suspend_power_down(void) {
// shouldn't power down TPM/FTM if we want a breathing LED
// also shouldn't power down USB
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
- rgblight_timer_disable();
- if (!is_suspended) {
- is_suspended = true;
- rgblight_enabled = rgblight_config.enable;
- rgblight_disable_noeeprom();
- }
+ rgblight_suspend();
#endif
suspend_power_down_kb();
@@ -136,11 +128,7 @@ void suspend_wakeup_init(void) {
#endif /* BACKLIGHT_ENABLE */
led_set(host_keyboard_leds());
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
- is_suspended = false;
- if (rgblight_enabled) {
- rgblight_enable_noeeprom();
- }
- rgblight_timer_enable();
+ rgblight_wakeup();
#endif
suspend_wakeup_init_kb();
}