From ecaf872177e771b6b7e331b47a5b68832b5dd126 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 14 Apr 2009 12:07:41 +0000 Subject: Corrected AudioInput and AudioOutput demos, to fix endpoint underflows due to rounding in the sample reload timer. --- Demos/Device/AudioInput/AudioInput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Demos/Device/AudioInput/AudioInput.c') diff --git a/Demos/Device/AudioInput/AudioInput.c b/Demos/Device/AudioInput/AudioInput.c index b0c029573..fca24c360 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) - ((F_CPU % AUDIO_SAMPLE_FREQUENCY) == 0 ? 1 : 0); + OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY) - 1; TCCR0A = (1 << WGM01); // CTC mode TCCR0B = (1 << CS00); // Fcpu speed } -- cgit v1.2.3