summaryrefslogtreecommitdiffstats
path: root/quantum/audio.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-04-15 13:44:07 -0400
committerJack Humbert <jack.humb@gmail.com>2016-04-15 13:44:07 -0400
commitee2ee7f4f049dda385a9db7dddd8e7e91681315b (patch)
tree05010164aa11846bb055b436292966befe80aac3 /quantum/audio.c
parentbb0836c62016f482f517771a9f5a8dbc68bd0a1c (diff)
audio note length fixes
Diffstat (limited to 'quantum/audio.c')
-rw-r--r--quantum/audio.c7
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) {