diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-04-15 13:44:07 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-04-15 13:44:07 -0400 |
commit | ee2ee7f4f049dda385a9db7dddd8e7e91681315b (patch) | |
tree | 05010164aa11846bb055b436292966befe80aac3 /quantum/audio.c | |
parent | bb0836c62016f482f517771a9f5a8dbc68bd0a1c (diff) |
audio note length fixes
Diffstat (limited to 'quantum/audio.c')
-rw-r--r-- | quantum/audio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/quantum/audio.c b/quantum/audio.c index f29d941d7c..50e5505fe0 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) { |