summaryrefslogtreecommitdiffstats
path: root/quantum/audio.c
diff options
context:
space:
mode:
authorIBNobody <ibnobody@gmail.com>2016-04-17 23:16:36 -0500
committerIBNobody <ibnobody@gmail.com>2016-04-17 23:16:36 -0500
commit82ec81660e9816b72bc0d661becc399c62594970 (patch)
tree7926f955678faaf44120566ad47dfbcfa8144b3c /quantum/audio.c
parentef73ab662812232f5e73c8098a059439dcb201fa (diff)
parentd94960be5b32b6a4019b822550ae09cf802bfcd7 (diff)
Merge remote-tracking branch 'refs/remotes/jackhumbert/master' into personal_atomic_planck
Diffstat (limited to 'quantum/audio.c')
-rw-r--r--quantum/audio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/quantum/audio.c b/quantum/audio.c
index ba85e418ed..627e3d80a1 100644
--- a/quantum/audio.c
+++ b/quantum/audio.c
@@ -257,7 +257,7 @@ ISR(TIMER3_COMPA_vect) {
place = 0.0;
}
ICR3 = (int)(((double)F_CPU) / (frequencies[voice_place] * CPU_PRESCALER)); // Set max to the period
- OCR3A = (int)((((double)F_CPU) /(frequencies[voice_place] * CPU_PRESCALER)) * note_timbre); // Set compare to half the period
+ OCR3A = (int)((((double)F_CPU) / (frequencies[voice_place] * CPU_PRESCALER)) * note_timbre); // Set compare to half the period
//OCR3A = (int)(((double)F_CPU) / (frequencies[voice_place] * CPU_PRESCALER)) >> 1 * duty_place; // Set compare to half the period
place++;
// if (duty_counter > (frequencies[voice_place] / 500)) {
@@ -354,6 +354,7 @@ if (audio_config.enable) {
// Cancel note if a note is playing
if (note)
stop_all_notes();
+ notes = true;
notes_pointer = np;
notes_count = n_count;
@@ -379,7 +380,6 @@ if (audio_config.enable) {
TCCR3A |= _BV(COM3A1);
#endif
- notes = true;
}
}
@@ -410,6 +410,7 @@ if (audio_config.enable && voices < 8) {
// Cancel notes if notes are playing
if (notes)
stop_all_notes();
+ note = true;
#ifdef PWM_AUDIO
freq = freq / SAMPLE_RATE;
#endif
@@ -441,7 +442,6 @@ if (audio_config.enable && voices < 8) {
TCCR3A |= _BV(COM3A1);
#endif
- note = true;
}
}