Skip to content

Commit

Permalink
[Audio] Use function instead of define for playing songs
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Jan 19, 2024
1 parent 7e48ac7 commit fe4342c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions users/drashna/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ layer_state_t layer_state_set_user(layer_state_t state) {
if (is_click_on) {
clicky_off();
}
PLAY_LOOP(doom_song);
audio_play_melody(&doom_song, NOTE_ARRAY_SIZE(doom_song), true);
} else {
if (is_click_on) {
clicky_on();
}
stop_all_notes();
audio_stop_all();
}
}
#endif
Expand Down Expand Up @@ -255,7 +255,7 @@ layer_state_t default_layer_state_set_user(layer_state_t state) {
if (has_init_been_ran) {
#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS)
if (get_highest_layer(state) < MAX_LAYER) {
PLAY_SONG(default_layer_songs[get_highest_layer(state)]);
audio_play_melody(&default_layer_songs[get_highest_layer(state)], NOTE_ARRAY_SIZE(default_layer_songs[get_highest_layer(state)]), false);
}
#endif
eeconfig_update_default_layer(state);
Expand Down
2 changes: 1 addition & 1 deletion users/drashna/drashna.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *co
#endif

# if defined(AUDIO_ENABLE)
PLAY_SONG(autocorrect_song);
audio_play_melody(&autocorrect_song, NOTE_ARRAY_SIZE(autocorrect_song), false);
# endif
return true;
}
Expand Down

0 comments on commit fe4342c

Please sign in to comment.