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
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
* - Fixed GenericHID demo not starting USB and HID management tasks when not using interrupt driven modes (thanks to Carl Kjeldsen)\r
* - Fixed RNDISEthenet demo checking the incorrect message field for packet size constraints (thanks to Jonathan)\r
* - Fixed WriteNextReport code in the GenericHIDHost demo using incorrect parameter types and not selecting the correct endpoint\r
+ * - Adjusted sample CTC timer calculations in the AudioOutput and AudioInput demos to account for situations where the division results\r
+ * in a value with no remainder, requiring one to be subtracted from the result (thanks to Robin Theunis)\r
*\r
* \section Sec_ChangeLog090401 Version 090401\r
*\r