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
- TCCR0B = (1 << CS00); // Fcpu speed \r
+ TCCR0B = (1 << CS01); // Fcpu/8 speed\r
}\r
\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
/* Audio sample is ADC value scaled to fit the entire range */\r
int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult());\r
\r
-#if defined(MICROPHONE_BIASED_TO_HALF_RAIL)\r
+ #if defined(MICROPHONE_BIASED_TO_HALF_RAIL)\r
/* Microphone is biased to half rail voltage, subtract the bias from the sample value */\r
AudioSample -= (SAMPLE_MAX_RANGE / 2));\r
-#endif\r
+ #endif\r
\r
/* Write the sample to the buffer */\r
Endpoint_Write_Word_LE(AudioSample);\r