diff options
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r-- | quantum/quantum.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 22aa52838..5e0cde8a2 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -656,6 +656,26 @@ void matrix_init_quantum() { | |||
656 | } | 656 | } |
657 | 657 | ||
658 | void matrix_scan_quantum() { | 658 | void matrix_scan_quantum() { |
659 | #if defined(AUDIO_ENABLE) | ||
660 | // There are some tasks that need to be run a little bit | ||
661 | // after keyboard startup, or else they will not work correctly | ||
662 | // because of interaction with the USB device state, which | ||
663 | // may still be in flux... | ||
664 | // | ||
665 | // At the moment the only feature that needs this is the | ||
666 | // startup song. | ||
667 | static bool delayed_tasks_run = false; | ||
668 | static uint16_t delayed_task_timer = 0; | ||
669 | if (!delayed_tasks_run) { | ||
670 | if (!delayed_task_timer) { | ||
671 | delayed_task_timer = timer_read(); | ||
672 | } else if (timer_elapsed(delayed_task_timer) > 300) { | ||
673 | audio_startup(); | ||
674 | delayed_tasks_run = true; | ||
675 | } | ||
676 | } | ||
677 | #endif | ||
678 | |||
659 | #if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) | 679 | #if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) |
660 | matrix_scan_music(); | 680 | matrix_scan_music(); |
661 | #endif | 681 | #endif |