[Keyboard] Fix default keymaps for OLKB boards to play Startup Sound (#6721)
* Fix Planck default keymap to play sounds on rev6 The dip_switch_update callback was overriding the default startup sound. This should prevent that from happening, and still allow it to play sounds, or stop them, when appropriate. * Fix Preonic default keymap to play sounds on Rev 3 The dip_switch_update callback was overriding the default startup sound. This should prevent that from happening, and still allow it to play sounds, or stop them, when appropriate.
This commit is contained in:
parent
265d8abee1
commit
6c871408df
2 changed files with 70 additions and 62 deletions
|
@ -291,27 +291,27 @@ void encoder_update(bool clockwise) {
|
|||
|
||||
void dip_switch_update_user(uint8_t index, bool active) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
case 0: {
|
||||
static bool play_sound = false;
|
||||
if (active) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(plover_song);
|
||||
if (play_sound) { PLAY_SONG(plover_song); }
|
||||
#endif
|
||||
layer_on(_ADJUST);
|
||||
} else {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(plover_gb_song);
|
||||
if (play_sound) { PLAY_SONG(plover_gb_song); }
|
||||
#endif
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
play_sound = true;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
if (active) {
|
||||
muse_mode = true;
|
||||
} else {
|
||||
muse_mode = false;
|
||||
#ifdef AUDIO_ENABLE
|
||||
stop_all_notes();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,6 +328,11 @@ void matrix_scan_user(void) {
|
|||
}
|
||||
}
|
||||
muse_counter = (muse_counter + 1) % muse_tempo;
|
||||
} else {
|
||||
if (muse_counter) {
|
||||
stop_all_notes();
|
||||
muse_counter = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -273,13 +273,11 @@ void dip_switch_update_user(uint8_t index, bool active) {
|
|||
muse_mode = true;
|
||||
} else {
|
||||
muse_mode = false;
|
||||
#ifdef AUDIO_ENABLE
|
||||
stop_all_notes();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
xs}
|
||||
}
|
||||
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
if (muse_mode) {
|
||||
|
@ -292,6 +290,11 @@ void matrix_scan_user(void) {
|
|||
}
|
||||
}
|
||||
muse_counter = (muse_counter + 1) % muse_tempo;
|
||||
} else {
|
||||
if (muse_counter) {
|
||||
stop_all_notes();
|
||||
muse_counter = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue