aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/AudioInput/AudioInput.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/AudioInput/AudioInput.c')
-rw-r--r--Demos/Device/AudioInput/AudioInput.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Demos/Device/AudioInput/AudioInput.c b/Demos/Device/AudioInput/AudioInput.c
index f41306f3b..b0c029573 100644
--- a/Demos/Device/AudioInput/AudioInput.c
+++ b/Demos/Device/AudioInput/AudioInput.c
@@ -95,7 +95,7 @@ EVENT_HANDLER(USB_Connect)
UpdateStatus(Status_USBEnumerating);
/* Sample reload timer initialization */
- OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY);
+ OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY) - ((F_CPU % AUDIO_SAMPLE_FREQUENCY) == 0 ? 1 : 0);
TCCR0A = (1 << WGM01); // CTC mode
TCCR0B = (1 << CS00); // Fcpu speed
}