diff options
author | Joshua Diamond <josh@windowoffire.com> | 2021-01-31 17:25:55 -0500 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2021-01-31 17:37:16 -0800 |
commit | 9ee0271c00c05ee5dddb7d77b04b5ec2fac2bd41 (patch) | |
tree | d0d6d69534c0528d1e412832a2a137f44a580f94 /tmk_core/common | |
parent | 515c0802520ff51a9730a79d661106ce80bf1523 (diff) |
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/common')
-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 aa0d42680a..a879d6bab0 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -100,8 +100,7 @@ static void power_down(uint8_t wdto) { led_set(leds_off); # ifdef AUDIO_ENABLE - // This sometimes disables the start-up noise, so it's been disabled - // stop_all_notes(); + stop_all_notes(); # endif /* AUDIO_ENABLE */ # if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) rgblight_timer_disable(); @@ -165,6 +164,7 @@ __attribute__((weak)) void suspend_wakeup_init_user(void) {} * FIXME: needs doc */ __attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); } + /** \brief run immediately after wakeup * * FIXME: needs doc diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 24efb0ac4c..c3b690b164 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c @@ -12,6 +12,10 @@ #include "led.h" #include "wait.h" +#ifdef AUDIO_ENABLE +# include "audio.h" +#endif /* AUDIO_ENABLE */ + #ifdef BACKLIGHT_ENABLE # include "backlight.h" #endif @@ -73,6 +77,9 @@ void suspend_power_down(void) { rgblight_disable_noeeprom(); } #endif +#ifdef AUDIO_ENABLE + stop_all_notes(); +#endif /* AUDIO_ENABLE */ suspend_power_down_kb(); // on AVR, this enables the watchdog for 15ms (max), and goes to |