preonic: added layer tone for BASE layer

This commit is contained in:
Valerie Wolfe 2022-06-20 16:21:43 -04:00
parent d75879cac0
commit ab079d0c60
2 changed files with 7 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#define BOOT_SONG Q__NOTE(_F5), Q__NOTE(_G5), Q__NOTE(_C6) #define BOOT_SONG Q__NOTE(_F5), Q__NOTE(_G5), Q__NOTE(_C6)
#define STARTUP_SONG SONG(BOOT_SONG) #define STARTUP_SONG SONG(BOOT_SONG)
#define TONE_BASE S__NOTE(_C5)
#define TONE_ALT S__NOTE(_F5) #define TONE_ALT S__NOTE(_F5)
#define TONE_FN S__NOTE(_G5) #define TONE_FN S__NOTE(_G5)
#endif #endif

View file

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