diff options
| author | Joshua Diamond <josh@windowoffire.com> | 2021-01-31 17:25:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-01 09:25:55 +1100 |
| commit | ae4ee7553abfaa2149fcea04c3cbee20f3b8c7a5 (patch) | |
| tree | 8baafbc7332a9ed95e5ff35de3f9ed5f21826f4f /tmk_core | |
| parent | db11a2a1fd7a7ff9c458e8ec9e963a61a1192bf3 (diff) | |
| download | qmk_firmware-ae4ee7553abfaa2149fcea04c3cbee20f3b8c7a5.tar.gz qmk_firmware-ae4ee7553abfaa2149fcea04c3cbee20f3b8c7a5.zip | |
Stop sounds when suspended (#11553)
* fix stopping audio on suspend vs. startup sound
* trim firmware size
* fix stuck audio on startup (ARM)
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/avr/suspend.c | 4 | ||||
| -rw-r--r-- | tmk_core/common/chibios/suspend.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 86c3df040..9db0e0064 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c | |||
| @@ -97,8 +97,7 @@ static void power_down(uint8_t wdto) { | |||
| 97 | led_set(leds_off); | 97 | led_set(leds_off); |
| 98 | 98 | ||
| 99 | # ifdef AUDIO_ENABLE | 99 | # ifdef AUDIO_ENABLE |
| 100 | // This sometimes disables the start-up noise, so it's been disabled | 100 | stop_all_notes(); |
| 101 | // stop_all_notes(); | ||
| 102 | # endif /* AUDIO_ENABLE */ | 101 | # endif /* AUDIO_ENABLE */ |
| 103 | # if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 102 | # if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 104 | rgblight_suspend(); | 103 | rgblight_suspend(); |
| @@ -157,6 +156,7 @@ __attribute__((weak)) void suspend_wakeup_init_user(void) {} | |||
| 157 | * FIXME: needs doc | 156 | * FIXME: needs doc |
| 158 | */ | 157 | */ |
| 159 | __attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); } | 158 | __attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); } |
| 159 | |||
| 160 | /** \brief run immediately after wakeup | 160 | /** \brief run immediately after wakeup |
| 161 | * | 161 | * |
| 162 | * FIXME: needs doc | 162 | * FIXME: needs doc |
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 796056019..49e20641f 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c | |||
| @@ -12,6 +12,10 @@ | |||
| 12 | #include "led.h" | 12 | #include "led.h" |
| 13 | #include "wait.h" | 13 | #include "wait.h" |
| 14 | 14 | ||
| 15 | #ifdef AUDIO_ENABLE | ||
| 16 | # include "audio.h" | ||
| 17 | #endif /* AUDIO_ENABLE */ | ||
| 18 | |||
| 15 | #ifdef BACKLIGHT_ENABLE | 19 | #ifdef BACKLIGHT_ENABLE |
| 16 | # include "backlight.h" | 20 | # include "backlight.h" |
| 17 | #endif | 21 | #endif |
| @@ -65,6 +69,9 @@ void suspend_power_down(void) { | |||
| 65 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 69 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 66 | rgblight_suspend(); | 70 | rgblight_suspend(); |
| 67 | #endif | 71 | #endif |
| 72 | #ifdef AUDIO_ENABLE | ||
| 73 | stop_all_notes(); | ||
| 74 | #endif /* AUDIO_ENABLE */ | ||
| 68 | 75 | ||
| 69 | suspend_power_down_kb(); | 76 | suspend_power_down_kb(); |
| 70 | // on AVR, this enables the watchdog for 15ms (max), and goes to | 77 | // on AVR, this enables the watchdog for 15ms (max), and goes to |
