projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make Audio device demos compatible with AVRs running at 16MHz instead of 8MHz.
[pub/USBasp.git]
/
Demos
/
Device
/
LowLevel
/
AudioOutput
/
AudioOutput.c
diff --git
a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
index
28e57c4
..
b9c306c
100644
(file)
--- a/
Demos/Device/LowLevel/AudioOutput/AudioOutput.c
+++ b/
Demos/Device/LowLevel/AudioOutput/AudioOutput.c
@@
-79,9
+79,9
@@
void EVENT_USB_Device_Connect(void)
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
\r
\r
/* Sample reload timer initialization */
\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
\r
\r
/* Sample reload timer initialization */
\r
- OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY) - 1;
\r
+ OCR0A = (F_CPU /
8 /
AUDIO_SAMPLE_FREQUENCY) - 1;
\r
TCCR0A = (1 << WGM01); // CTC mode
\r
TCCR0A = (1 << WGM01); // CTC mode
\r
- TCCR0B = (1 << CS0
0); // Fcpu
speed
\r
+ TCCR0B = (1 << CS0
1); // Fcpu/8
speed
\r
\r
#if defined(AUDIO_OUT_MONO)
\r
/* Set speaker as output */
\r
\r
#if defined(AUDIO_OUT_MONO)
\r
/* Set speaker as output */
\r