From 0ce2950d811b8dc11e46602e7490d795d8ddfb5d Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 8 Nov 2010 03:41:48 +0000 Subject: Added board hardware driver support for the Adafruit U4 breakout board. Fixed calculation of timer register reload values derived from F_CPU; must subtract one from the division result for the compare value to be correct. Change AVRISP-MKII rescue clock speed to 4MHz to ensure that a 125KHz ISP speed works regardless of the target's fuses (i.e. DIV8 set). --- Demos/Device/ClassDriver/AudioInput/AudioInput.c | 2 +- Demos/Device/ClassDriver/AudioOutput/AudioOutput.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Demos/Device/ClassDriver') diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index cea89c5da..8314dd091 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -132,7 +132,7 @@ void EVENT_USB_Device_Connect(void) /* Sample reload timer initialization */ TIMSK0 = (1 << OCIE0A); - OCR0A = (F_CPU / 8 / AUDIO_SAMPLE_FREQUENCY) - 1; + OCR0A = ((F_CPU / 8 / AUDIO_SAMPLE_FREQUENCY) - 1); TCCR0A = (1 << WGM01); // CTC mode TCCR0B = (1 << CS01); // Fcpu/8 speed } diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c index bf0e22a6f..4650cd8c5 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c @@ -134,7 +134,7 @@ void EVENT_USB_Device_Connect(void) /* Sample reload timer initialization */ TIMSK0 = (1 << OCIE0A); - OCR0A = (F_CPU / 8 / AUDIO_SAMPLE_FREQUENCY) - 1; + OCR0A = ((F_CPU / 8 / AUDIO_SAMPLE_FREQUENCY) - 1); TCCR0A = (1 << WGM01); // CTC mode TCCR0B = (1 << CS01); // Fcpu/8 speed -- cgit v1.2.3