2018-05-05 01:36:23 +00:00
|
|
|
|
|
|
|
// ....................................................................... Audio
|
|
|
|
|
|
|
|
void matrix_init_user(void)
|
|
|
|
{
|
|
|
|
#ifdef STENO_ENABLE
|
|
|
|
steno_set_mode(STENO_MODE_BOLT); // or STENO_MODE_GEMINI
|
|
|
|
#endif
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
startup_user();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef BACKLIGHT_ENABLE
|
2023-07-06 08:48:02 +00:00
|
|
|
bool led_update_user(led_t led_state)
|
2018-05-05 01:36:23 +00:00
|
|
|
{
|
2023-07-06 08:48:02 +00:00
|
|
|
static led_t old_led_state = {0};
|
2018-05-05 01:36:23 +00:00
|
|
|
_delay_ms(10); // gets rid of tick
|
|
|
|
if (!is_playing_notes()) {
|
2023-07-06 08:48:02 +00:00
|
|
|
if (led_state.caps_lock && !old_led_state.caps_lock) {
|
2018-05-05 01:36:23 +00:00
|
|
|
// if capslock LED is turning on
|
|
|
|
PLAY_SONG(song_caps_on);
|
|
|
|
}
|
2023-07-06 08:48:02 +00:00
|
|
|
else if (!led_state.caps_lock && old_led_state.caps_lock) {
|
2018-05-05 01:36:23 +00:00
|
|
|
// if capslock LED is turning off
|
|
|
|
PLAY_SONG(song_caps_off);
|
|
|
|
}
|
|
|
|
}
|
2023-07-06 08:48:02 +00:00
|
|
|
old_led_state = led_state;
|
|
|
|
return false;
|
2018-05-05 01:36:23 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void startup_user(void)
|
|
|
|
{
|
|
|
|
_delay_ms(20); // gets rid of tick
|
|
|
|
PLAY_SONG(song_startup);
|
|
|
|
}
|
|
|
|
|
|
|
|
void shutdown_user(void)
|
|
|
|
{
|
|
|
|
PLAY_SONG(song_goodbye);
|
|
|
|
_delay_ms(150);
|
|
|
|
stop_all_notes();
|
|
|
|
}
|
|
|
|
|
|
|
|
void music_on_user(void)
|
|
|
|
{
|
|
|
|
music_scale_user();
|
|
|
|
}
|
|
|
|
|
|
|
|
void music_scale_user(void)
|
|
|
|
{
|
|
|
|
PLAY_SONG(music_scale);
|
|
|
|
}
|
|
|
|
#endif
|