summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2021-01-31 17:25:55 -0500
committerGitHub <noreply@github.com>2021-02-01 09:25:55 +1100
commitae4ee7553abfaa2149fcea04c3cbee20f3b8c7a5 (patch)
tree8baafbc7332a9ed95e5ff35de3f9ed5f21826f4f /tmk_core/common
parentdb11a2a1fd7a7ff9c458e8ec9e963a61a1192bf3 (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.c4
-rw-r--r--tmk_core/common/chibios/suspend.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 86c3df040a..9db0e0064a 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) {
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_suspend();
@@ -157,6 +156,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 796056019f..49e20641fb 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
@@ -65,6 +69,9 @@ void suspend_power_down(void) {
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
rgblight_suspend();
#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