projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjusted sample CTC timer calculations in the AudioOutput and AudioInput demos to...
[pub/USBasp.git]
/
Demos
/
Device
/
AudioInput
/
AudioInput.c
diff --git
a/Demos/Device/AudioInput/AudioInput.c
b/Demos/Device/AudioInput/AudioInput.c
index
f41306f
..
b0c0295
100644
(file)
--- a/
Demos/Device/AudioInput/AudioInput.c
+++ b/
Demos/Device/AudioInput/AudioInput.c
@@
-95,7
+95,7
@@
EVENT_HANDLER(USB_Connect)
UpdateStatus(Status_USBEnumerating);
\r
\r
/* Sample reload timer initialization */
\r
UpdateStatus(Status_USBEnumerating);
\r
\r
/* Sample reload timer initialization */
\r
- OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY);
\r
+ OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY)
- ((F_CPU % AUDIO_SAMPLE_FREQUENCY) == 0 ? 1 : 0)
;
\r
TCCR0A = (1 << WGM01); // CTC mode
\r
TCCR0B = (1 << CS00); // Fcpu speed
\r
}
\r
TCCR0A = (1 << WGM01); // CTC mode
\r
TCCR0B = (1 << CS00); // Fcpu speed
\r
}
\r