diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-04-14 12:07:41 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-04-14 12:07:41 +0000 |
| commit | 50d425a253c5e05bae529496c463641ab9d271f9 (patch) | |
| tree | 233b76b77d998ce10f3c82cc5d4d14d46dcd9d1f /Demos/Device/AudioInput | |
| parent | f4d0b680163496ab5a65531b6641e23616938585 (diff) | |
Corrected AudioInput and AudioOutput demos, to fix endpoint underflows due to rounding in the sample reload timer.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@505 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Device/AudioInput')
| -rw-r--r-- | Demos/Device/AudioInput/AudioInput.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Demos/Device/AudioInput/AudioInput.c b/Demos/Device/AudioInput/AudioInput.c index b0c02957..fca24c36 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
}
|
