X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Faudio%2Faudio.c;h=3da164c736ef44611ab77f7de713e199b927141f;hb=dfebfecd48ebe972e7374e9ce26c795e3ddc88ae;hp=c948a60d6cfced46b2369372416b025beb32361d;hpb=530dd446cb7bbff7b7f9a8075726bfbb4eb9a2a3;p=qmk_firmware.git diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index c948a60d6..3da164c73 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -141,7 +141,7 @@ uint16_t notes_count; bool notes_repeat; bool note_resting = false; -uint8_t current_note = 0; +uint16_t current_note = 0; uint8_t rest_counter = 0; #ifdef VIBRATO_ENABLE @@ -223,7 +223,7 @@ void audio_init() TCCR1B = (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (1 << CS11) | (0 << CS10); TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER)); TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre); - #endif + #endif audio_initialized = true; } @@ -231,7 +231,7 @@ void audio_init() if (audio_config.enable) { PLAY_SONG(startup_song); } - + } void stop_all_notes() @@ -464,7 +464,7 @@ ISR(TIMER3_AUDIO_vect) note_position++; bool end_of_note = false; if (TIMER_3_PERIOD > 0) { - if (!note_resting) + if (!note_resting) end_of_note = (note_position >= (note_length / TIMER_3_PERIOD * 0xFFFF - 1)); else end_of_note = (note_position >= (note_length)); @@ -604,7 +604,7 @@ ISR(TIMER1_AUDIO_vect) note_position++; bool end_of_note = false; if (TIMER_1_PERIOD > 0) { - if (!note_resting) + if (!note_resting) end_of_note = (note_position >= (note_length / TIMER_1_PERIOD * 0xFFFF - 1)); else end_of_note = (note_position >= (note_length));