diff options
| -rw-r--r-- | quantum/led_matrix.c | 9 | ||||
| -rw-r--r-- | quantum/rgb_matrix.c | 9 | ||||
| -rw-r--r-- | tmk_core/common/avr/suspend.c | 4 | ||||
| -rw-r--r-- | tmk_core/common/chibios/suspend.c | 8 |
4 files changed, 14 insertions, 16 deletions
diff --git a/quantum/led_matrix.c b/quantum/led_matrix.c index 5dd37dff1..3674c9b97 100644 --- a/quantum/led_matrix.c +++ b/quantum/led_matrix.c | |||
| @@ -75,7 +75,7 @@ last_hit_t g_last_hit_tracker; | |||
| 75 | #endif // LED_MATRIX_KEYREACTIVE_ENABLED | 75 | #endif // LED_MATRIX_KEYREACTIVE_ENABLED |
| 76 | 76 | ||
| 77 | // internals | 77 | // internals |
| 78 | static bool suspend_state = false; | 78 | static bool suspend_state = false; |
| 79 | static uint8_t led_last_enable = UINT8_MAX; | 79 | static uint8_t led_last_enable = UINT8_MAX; |
| 80 | static uint8_t led_last_effect = UINT8_MAX; | 80 | static uint8_t led_last_effect = UINT8_MAX; |
| 81 | static effect_params_t led_effect_params = {0, LED_FLAG_ALL, false}; | 81 | static effect_params_t led_effect_params = {0, LED_FLAG_ALL, false}; |
| @@ -324,12 +324,11 @@ void led_matrix_task(void) { | |||
| 324 | 324 | ||
| 325 | // Ideally we would also stop sending zeros to the LED driver PWM buffers | 325 | // Ideally we would also stop sending zeros to the LED driver PWM buffers |
| 326 | // while suspended and just do a software shutdown. This is a cheap hack for now. | 326 | // while suspended and just do a software shutdown. This is a cheap hack for now. |
| 327 | bool suspend_backlight = | 327 | bool suspend_backlight = suspend_state || |
| 328 | suspend_state || | ||
| 329 | #if LED_DISABLE_TIMEOUT > 0 | 328 | #if LED_DISABLE_TIMEOUT > 0 |
| 330 | (led_anykey_timer > (uint32_t)LED_DISABLE_TIMEOUT) || | 329 | (led_anykey_timer > (uint32_t)LED_DISABLE_TIMEOUT) || |
| 331 | #endif // LED_DISABLE_TIMEOUT > 0 | 330 | #endif // LED_DISABLE_TIMEOUT > 0 |
| 332 | false; | 331 | false; |
| 333 | 332 | ||
| 334 | uint8_t effect = suspend_backlight || !led_matrix_eeconfig.enable ? 0 : led_matrix_eeconfig.mode; | 333 | uint8_t effect = suspend_backlight || !led_matrix_eeconfig.enable ? 0 : led_matrix_eeconfig.mode; |
| 335 | 334 | ||
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 1f7604943..097c5302d 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
| @@ -128,7 +128,7 @@ last_hit_t g_last_hit_tracker; | |||
| 128 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 128 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
| 129 | 129 | ||
| 130 | // internals | 130 | // internals |
| 131 | static bool suspend_state = false; | 131 | static bool suspend_state = false; |
| 132 | static uint8_t rgb_last_enable = UINT8_MAX; | 132 | static uint8_t rgb_last_enable = UINT8_MAX; |
| 133 | static uint8_t rgb_last_effect = UINT8_MAX; | 133 | static uint8_t rgb_last_effect = UINT8_MAX; |
| 134 | static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false}; | 134 | static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false}; |
| @@ -409,12 +409,11 @@ void rgb_matrix_task(void) { | |||
| 409 | 409 | ||
| 410 | // Ideally we would also stop sending zeros to the LED driver PWM buffers | 410 | // Ideally we would also stop sending zeros to the LED driver PWM buffers |
| 411 | // while suspended and just do a software shutdown. This is a cheap hack for now. | 411 | // while suspended and just do a software shutdown. This is a cheap hack for now. |
| 412 | bool suspend_backlight = | 412 | bool suspend_backlight = suspend_state || |
| 413 | suspend_state || | ||
| 414 | #if RGB_DISABLE_TIMEOUT > 0 | 413 | #if RGB_DISABLE_TIMEOUT > 0 |
| 415 | (rgb_anykey_timer > (uint32_t)RGB_DISABLE_TIMEOUT) || | 414 | (rgb_anykey_timer > (uint32_t)RGB_DISABLE_TIMEOUT) || |
| 416 | #endif // RGB_DISABLE_TIMEOUT > 0 | 415 | #endif // RGB_DISABLE_TIMEOUT > 0 |
| 417 | false; | 416 | false; |
| 418 | 417 | ||
| 419 | uint8_t effect = suspend_backlight || !rgb_matrix_config.enable ? 0 : rgb_matrix_config.mode; | 418 | uint8_t effect = suspend_backlight || !rgb_matrix_config.enable ? 0 : rgb_matrix_config.mode; |
| 420 | 419 | ||
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 1c2bf9cb4..e9ee0aefd 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c | |||
| @@ -218,9 +218,9 @@ void suspend_wakeup_init(void) { | |||
| 218 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 218 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 219 | rgblight_wakeup(); | 219 | rgblight_wakeup(); |
| 220 | #endif | 220 | #endif |
| 221 | # if defined(RGB_MATRIX_ENABLE) | 221 | #if defined(RGB_MATRIX_ENABLE) |
| 222 | rgb_matrix_set_suspend_state(false); | 222 | rgb_matrix_set_suspend_state(false); |
| 223 | # endif | 223 | #endif |
| 224 | 224 | ||
| 225 | suspend_wakeup_init_kb(); | 225 | suspend_wakeup_init_kb(); |
| 226 | } | 226 | } |
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 1f4f93c45..14a9aecb3 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c | |||
| @@ -83,9 +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) | 86 | #if defined(RGB_MATRIX_ENABLE) |
| 87 | rgb_matrix_set_suspend_state(true); | 87 | rgb_matrix_set_suspend_state(true); |
| 88 | # endif | 88 | #endif |
| 89 | #ifdef AUDIO_ENABLE | 89 | #ifdef AUDIO_ENABLE |
| 90 | stop_all_notes(); | 90 | stop_all_notes(); |
| 91 | #endif /* AUDIO_ENABLE */ | 91 | #endif /* AUDIO_ENABLE */ |
| @@ -154,8 +154,8 @@ void suspend_wakeup_init(void) { | |||
| 154 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 154 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 155 | rgblight_wakeup(); | 155 | rgblight_wakeup(); |
| 156 | #endif | 156 | #endif |
| 157 | # if defined(RGB_MATRIX_ENABLE) | 157 | #if defined(RGB_MATRIX_ENABLE) |
| 158 | rgb_matrix_set_suspend_state(false); | 158 | rgb_matrix_set_suspend_state(false); |
| 159 | # endif | 159 | #endif |
| 160 | suspend_wakeup_init_kb(); | 160 | suspend_wakeup_init_kb(); |
| 161 | } | 161 | } |
