1
0
Fork 0

fixed small bug with AUDIO_ENABLED (#339)

This commit is contained in:
purpleP 2016-05-19 15:36:28 +03:00 committed by Jack Humbert
parent b732b79b49
commit 0275d444d7

View file

@ -20,7 +20,7 @@ void leader_end(void) {}
uint8_t starting_note = 0x0C; uint8_t starting_note = 0x0C;
int offset = 7; int offset = 7;
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
bool music_activated = false; bool music_activated = false;
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
@ -435,28 +435,29 @@ void matrix_scan_quantum() {
matrix_scan_kb(); matrix_scan_kb();
} }
#ifdef AUDIO_ENABLE
bool is_music_on(void) {
return (music_activated != 0);
}
bool is_music_on(void) { void music_toggle(void) {
return (music_activated != 0); if (!music_activated) {
} music_on();
} else {
music_off();
}
}
void music_toggle(void) { void music_on(void) {
if (!music_activated) { music_activated = 1;
music_on(); music_on_user();
} else { }
music_off();
}
}
void music_on(void) { void music_off(void) {
music_activated = 1; music_activated = 0;
music_on_user(); stop_all_notes();
} }
void music_off(void) {
music_activated = 0;
stop_all_notes();
}
#endif
__attribute__ ((weak)) __attribute__ ((weak))
void music_on_user() {} void music_on_user() {}