preonic: added layer tone for ALT layer

This commit is contained in:
Valerie Wolfe 2022-05-23 13:18:59 -04:00
parent c9d24b35bc
commit 5af65e78f2
2 changed files with 8 additions and 1 deletions

View file

@ -7,7 +7,8 @@
#define BOOT_SONG Q__NOTE(_F5), Q__NOTE(_G5), Q__NOTE(_C6)
#define STARTUP_SONG SONG(BOOT_SONG)
#define TONE_FN S__NOTE(_G5)
#define TONE_ALT S__NOTE(_F5)
#define TONE_FN S__NOTE(_G5)
#endif
#define MUSIC_MASK (keycode != KC_NO)

View file

@ -48,6 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
#ifdef AUDIO_ENABLE
float tone_alt[][2] = SONG(TONE_ALT);
float tone_fn[][2] = SONG(TONE_FN);
#endif
@ -58,6 +59,11 @@ void keyboard_post_init_user(void) {
layer_state_t layer_state_set_user(layer_state_t state) {
uint8_t layer = get_highest_layer(state);
switch(layer) {
case ALT:
#ifdef TONE_ALT
PLAY_SONG(tone_alt);
#endif
break;
case FN:
#ifdef TONE_FN
PLAY_SONG(tone_fn);