X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Faudio.c;h=50e5505fe0826dd6f74b833df26eb58558ab4ed8;hb=9cfc74c35b940884618b0fe1e6fd25c570e1c974;hp=f29d941d7cce0be321a060b38ae2278806a9223c;hpb=e1020672ac42a423a16747d2272cd2203bd3f988;p=qmk_firmware.git diff --git a/quantum/audio.c b/quantum/audio.c index f29d941d7..50e5505fe 100644 --- a/quantum/audio.c +++ b/quantum/audio.c @@ -255,7 +255,12 @@ ISR(TIMER3_COMPA_vect) { note_position++; - if (note_position >= note_length) { + bool end_of_note = false; + if (ICR3 > 0) + end_of_note = (note_position >= (note_length / ICR3 * 0xFFFF)); + else + end_of_note = (note_position >= (note_length * 0x7FF)); + if (end_of_note) { current_note++; if (current_note >= notes_length) { if (notes_repeat) {