summaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2021-01-11 03:07:09 -0500
committerDrashna Jael're <drashna@live.com>2021-02-02 09:35:53 -0800
commitdc11c3da3b4878ad3541356c3fe1ac5f36008904 (patch)
treee11e2e374a1e04eaf40d29dfb5df37db8d4e7755 /tmk_core/common
parentf1a82690bef927f531cb767d59e5e7e935100da0 (diff)
Lighting Layers should be disabled when suspended (#11442)
* Lighting Layers should be disabled when suspended * bugfixes
Diffstat (limited to 'tmk_core/common')
-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 807c837e36..b784a0835d 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
@@ -103,12 +100,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
// TODO: more power saving
@@ -176,11 +168,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 c3b690b164..49e20641fb 100644
--- a/tmk_core/common/chibios/suspend.c
+++ b/tmk_core/common/chibios/suspend.c
@@ -22,9 +22,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
@@ -70,12 +67,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
#ifdef AUDIO_ENABLE
stop_all_notes();
@@ -143,11 +135,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();
}