diff options
66 files changed, 98 insertions, 84 deletions
diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index 54c7b7e49..60fe4a4bc 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -71,8 +71,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE);
diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index a6e77550c..dce84a5f8 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -41,6 +41,7 @@ #include <avr/wdt.h>
#include <avr/boot.h>
#include <avr/eeprom.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include "Descriptors.h"
diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 704133f5d..8cc5fd409 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -109,8 +109,8 @@ int main (void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE);
diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index b90fee13f..21e8fce71 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -42,6 +42,7 @@ #include <avr/boot.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include "Descriptors.h"
diff --git a/Bootloaders/TeensyHID/TeensyHID.c b/Bootloaders/TeensyHID/TeensyHID.c index 4f09ac50b..fe20702cd 100644 --- a/Bootloaders/TeensyHID/TeensyHID.c +++ b/Bootloaders/TeensyHID/TeensyHID.c @@ -53,8 +53,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE);
diff --git a/Bootloaders/TeensyHID/TeensyHID.h b/Bootloaders/TeensyHID/TeensyHID.h index a53fca30f..a4773f8f5 100644 --- a/Bootloaders/TeensyHID/TeensyHID.h +++ b/Bootloaders/TeensyHID/TeensyHID.h @@ -41,6 +41,7 @@ #include <avr/wdt.h>
#include <avr/boot.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <util/delay.h>
#include <stdbool.h>
diff --git a/Demos/AudioInput/AudioInput.c b/Demos/AudioInput/AudioInput.c index f5474b497..0db41c3c1 100644 --- a/Demos/AudioInput/AudioInput.c +++ b/Demos/AudioInput/AudioInput.c @@ -63,8 +63,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/AudioInput/AudioInput.h b/Demos/AudioInput/AudioInput.h index 97978fdea..02c838039 100644 --- a/Demos/AudioInput/AudioInput.h +++ b/Demos/AudioInput/AudioInput.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include "Descriptors.h"
diff --git a/Demos/AudioOutput/AudioOutput.c b/Demos/AudioOutput/AudioOutput.c index 184910e81..3d2e3249e 100644 --- a/Demos/AudioOutput/AudioOutput.c +++ b/Demos/AudioOutput/AudioOutput.c @@ -66,8 +66,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/AudioOutput/AudioOutput.h b/Demos/AudioOutput/AudioOutput.h index 3b9923179..0ad9e5bf9 100644 --- a/Demos/AudioOutput/AudioOutput.h +++ b/Demos/AudioOutput/AudioOutput.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include "Descriptors.h"
diff --git a/Demos/BluetoothHost/BluetoothHost.c b/Demos/BluetoothHost/BluetoothHost.c index 50bd1a8fe..2e5ae44d2 100644 --- a/Demos/BluetoothHost/BluetoothHost.c +++ b/Demos/BluetoothHost/BluetoothHost.c @@ -74,8 +74,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/BluetoothHost/BluetoothHost.h b/Demos/BluetoothHost/BluetoothHost.h index 5fe9dbd1e..51d417356 100644 --- a/Demos/BluetoothHost/BluetoothHost.h +++ b/Demos/BluetoothHost/BluetoothHost.h @@ -35,6 +35,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include "BluetoothStack.h"
diff --git a/Demos/CDC/CDC.c b/Demos/CDC/CDC.c index 6e232a48b..eeae625cf 100644 --- a/Demos/CDC/CDC.c +++ b/Demos/CDC/CDC.c @@ -87,8 +87,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/CDC/CDC.h b/Demos/CDC/CDC.h index 98f30b52f..d953303f7 100644 --- a/Demos/CDC/CDC.h +++ b/Demos/CDC/CDC.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <string.h>
#include "Descriptors.h"
diff --git a/Demos/CDCHost/CDCHost.c b/Demos/CDCHost/CDCHost.c index ac6d89ad1..1f05ecb1f 100644 --- a/Demos/CDCHost/CDCHost.c +++ b/Demos/CDCHost/CDCHost.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/CDCHost/CDCHost.h b/Demos/CDCHost/CDCHost.h index 2adbefd30..21b9d67ed 100644 --- a/Demos/CDCHost/CDCHost.h +++ b/Demos/CDCHost/CDCHost.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/DualCDC/DualCDC.c b/Demos/DualCDC/DualCDC.c index 90f00997e..8e6e38907 100644 --- a/Demos/DualCDC/DualCDC.c +++ b/Demos/DualCDC/DualCDC.c @@ -101,8 +101,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/DualCDC/DualCDC.h b/Demos/DualCDC/DualCDC.h index 5a01e07f7..4c62abf9d 100644 --- a/Demos/DualCDC/DualCDC.h +++ b/Demos/DualCDC/DualCDC.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <string.h>
#include "Descriptors.h"
diff --git a/Demos/Joystick/Joystick.c b/Demos/Joystick/Joystick.c index 88d415843..cd8822705 100644 --- a/Demos/Joystick/Joystick.c +++ b/Demos/Joystick/Joystick.c @@ -58,8 +58,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Joystick/Joystick.h b/Demos/Joystick/Joystick.h index 966fa7e10..79c7e498f 100644 --- a/Demos/Joystick/Joystick.h +++ b/Demos/Joystick/Joystick.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <string.h>
#include "Descriptors.h"
diff --git a/Demos/Keyboard/Keyboard.c b/Demos/Keyboard/Keyboard.c index 92f4ae948..22d406dbe 100644 --- a/Demos/Keyboard/Keyboard.c +++ b/Demos/Keyboard/Keyboard.c @@ -77,8 +77,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Keyboard/Keyboard.h b/Demos/Keyboard/Keyboard.h index e1aed1ec9..6988e579a 100644 --- a/Demos/Keyboard/Keyboard.h +++ b/Demos/Keyboard/Keyboard.h @@ -41,6 +41,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/KeyboardFullInt/KeyboardFullInt.c b/Demos/KeyboardFullInt/KeyboardFullInt.c index 44f983059..ed081376d 100644 --- a/Demos/KeyboardFullInt/KeyboardFullInt.c +++ b/Demos/KeyboardFullInt/KeyboardFullInt.c @@ -70,8 +70,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/KeyboardFullInt/KeyboardFullInt.h b/Demos/KeyboardFullInt/KeyboardFullInt.h index 7711faaa3..cc6655a6a 100644 --- a/Demos/KeyboardFullInt/KeyboardFullInt.h +++ b/Demos/KeyboardFullInt/KeyboardFullInt.h @@ -41,6 +41,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/KeyboardHost/KeyboardHost.c b/Demos/KeyboardHost/KeyboardHost.c index dd05bdea2..74d65550e 100644 --- a/Demos/KeyboardHost/KeyboardHost.c +++ b/Demos/KeyboardHost/KeyboardHost.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/KeyboardHost/KeyboardHost.h b/Demos/KeyboardHost/KeyboardHost.h index 97695f748..388e50f52 100644 --- a/Demos/KeyboardHost/KeyboardHost.h +++ b/Demos/KeyboardHost/KeyboardHost.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c index ecff95114..424eb8502 100644 --- a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c +++ b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h index 22848eeaf..7ae54e6ad 100644 --- a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h +++ b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h @@ -41,6 +41,7 @@ #include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c index f0eec2b99..f7a0087e7 100644 --- a/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h index 6846e179e..fece67971 100644 --- a/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -35,6 +35,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/KeyboardMouse/KeyboardMouse.c b/Demos/KeyboardMouse/KeyboardMouse.c index 383c66a58..8108a3032 100644 --- a/Demos/KeyboardMouse/KeyboardMouse.c +++ b/Demos/KeyboardMouse/KeyboardMouse.c @@ -67,8 +67,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/KeyboardMouse/KeyboardMouse.h b/Demos/KeyboardMouse/KeyboardMouse.h index f5c1d4e77..9794159fc 100644 --- a/Demos/KeyboardMouse/KeyboardMouse.h +++ b/Demos/KeyboardMouse/KeyboardMouse.h @@ -35,6 +35,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/KeyboardViaInt/KeyboardViaInt.c b/Demos/KeyboardViaInt/KeyboardViaInt.c index 791650675..b66506df5 100644 --- a/Demos/KeyboardViaInt/KeyboardViaInt.c +++ b/Demos/KeyboardViaInt/KeyboardViaInt.c @@ -76,8 +76,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/KeyboardViaInt/KeyboardViaInt.h b/Demos/KeyboardViaInt/KeyboardViaInt.h index 833bc919b..7dfe60d19 100644 --- a/Demos/KeyboardViaInt/KeyboardViaInt.h +++ b/Demos/KeyboardViaInt/KeyboardViaInt.h @@ -41,6 +41,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/MIDI/MIDI.c b/Demos/MIDI/MIDI.c index a9c827a0d..c0e4f9df9 100644 --- a/Demos/MIDI/MIDI.c +++ b/Demos/MIDI/MIDI.c @@ -58,8 +58,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/MIDI/MIDI.h b/Demos/MIDI/MIDI.h index 1775c6374..733a7baed 100644 --- a/Demos/MIDI/MIDI.h +++ b/Demos/MIDI/MIDI.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include "Descriptors.h"
diff --git a/Demos/MassStorage/MassStorage.c b/Demos/MassStorage/MassStorage.c index fb61530ff..34fcee488 100644 --- a/Demos/MassStorage/MassStorage.c +++ b/Demos/MassStorage/MassStorage.c @@ -68,8 +68,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/MassStorage/MassStorage.h b/Demos/MassStorage/MassStorage.h index 4f0e5b58f..3525340ff 100644 --- a/Demos/MassStorage/MassStorage.h +++ b/Demos/MassStorage/MassStorage.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include "Descriptors.h"
#include "SCSI.h"
diff --git a/Demos/MassStorageHost/MassStorageHost.c b/Demos/MassStorageHost/MassStorageHost.c index ee4befd04..d042b78bb 100644 --- a/Demos/MassStorageHost/MassStorageHost.c +++ b/Demos/MassStorageHost/MassStorageHost.c @@ -63,8 +63,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/MassStorageHost/MassStorageHost.h b/Demos/MassStorageHost/MassStorageHost.h index 3ace6d46a..b130cfed3 100644 --- a/Demos/MassStorageHost/MassStorageHost.h +++ b/Demos/MassStorageHost/MassStorageHost.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <ctype.h>
diff --git a/Demos/Mouse/Mouse.c b/Demos/Mouse/Mouse.c index 9080efba3..3e59706c9 100644 --- a/Demos/Mouse/Mouse.c +++ b/Demos/Mouse/Mouse.c @@ -76,8 +76,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Mouse/Mouse.h b/Demos/Mouse/Mouse.h index 1c7b5888d..50908129a 100644 --- a/Demos/Mouse/Mouse.h +++ b/Demos/Mouse/Mouse.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/MouseFullInt/MouseFullInt.c b/Demos/MouseFullInt/MouseFullInt.c index 28267a14f..98782b6cf 100644 --- a/Demos/MouseFullInt/MouseFullInt.c +++ b/Demos/MouseFullInt/MouseFullInt.c @@ -69,8 +69,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/MouseFullInt/MouseFullInt.h b/Demos/MouseFullInt/MouseFullInt.h index 9fdc51d3b..f46f7ef98 100644 --- a/Demos/MouseFullInt/MouseFullInt.h +++ b/Demos/MouseFullInt/MouseFullInt.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/MouseHost/MouseHost.c b/Demos/MouseHost/MouseHost.c index 2bc13a907..ee7aec9d5 100644 --- a/Demos/MouseHost/MouseHost.c +++ b/Demos/MouseHost/MouseHost.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/MouseHost/MouseHost.h b/Demos/MouseHost/MouseHost.h index 9e474956b..1bd52ebea 100644 --- a/Demos/MouseHost/MouseHost.h +++ b/Demos/MouseHost/MouseHost.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/MouseHostViaInt/MouseHostViaInt.c b/Demos/MouseHostViaInt/MouseHostViaInt.c index c4c377858..a44f707d9 100644 --- a/Demos/MouseHostViaInt/MouseHostViaInt.c +++ b/Demos/MouseHostViaInt/MouseHostViaInt.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/MouseHostViaInt/MouseHostViaInt.h b/Demos/MouseHostViaInt/MouseHostViaInt.h index c4238c80b..459bc2261 100644 --- a/Demos/MouseHostViaInt/MouseHostViaInt.h +++ b/Demos/MouseHostViaInt/MouseHostViaInt.h @@ -41,6 +41,7 @@ #include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/MouseHostWithParser/MouseHostWithParser.c b/Demos/MouseHostWithParser/MouseHostWithParser.c index 97bad3b5b..5ccda4912 100644 --- a/Demos/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/MouseHostWithParser/MouseHostWithParser.c @@ -59,8 +59,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/MouseHostWithParser/MouseHostWithParser.h b/Demos/MouseHostWithParser/MouseHostWithParser.h index 6d1ce32d0..b59ab9a78 100644 --- a/Demos/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/MouseHostWithParser/MouseHostWithParser.h @@ -35,6 +35,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
diff --git a/Demos/MouseViaInt/MouseViaInt.c b/Demos/MouseViaInt/MouseViaInt.c index a4b863c13..445fb4994 100644 --- a/Demos/MouseViaInt/MouseViaInt.c +++ b/Demos/MouseViaInt/MouseViaInt.c @@ -74,8 +74,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/MouseViaInt/MouseViaInt.h b/Demos/MouseViaInt/MouseViaInt.h index 6f4b9abe5..ccc37ef3c 100644 --- a/Demos/MouseViaInt/MouseViaInt.h +++ b/Demos/MouseViaInt/MouseViaInt.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
diff --git a/Demos/RNDISEthernet/RNDISEthernet.c b/Demos/RNDISEthernet/RNDISEthernet.c index 255a53b3d..3f9bb187a 100644 --- a/Demos/RNDISEthernet/RNDISEthernet.c +++ b/Demos/RNDISEthernet/RNDISEthernet.c @@ -60,8 +60,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/RNDISEthernet/RNDISEthernet.h b/Demos/RNDISEthernet/RNDISEthernet.h index 4a0f3c183..83e49ce84 100644 --- a/Demos/RNDISEthernet/RNDISEthernet.h +++ b/Demos/RNDISEthernet/RNDISEthernet.h @@ -39,9 +39,10 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <avr/power.h>
#include <string.h>
#include <stdio.h>
- #include <avr/pgmspace.h>
#include "Descriptors.h"
#include "RNDIS.h"
diff --git a/Demos/StillImageHost/StillImageHost.h b/Demos/StillImageHost/StillImageHost.h index 5669c827c..7757b0807 100644 --- a/Demos/StillImageHost/StillImageHost.h +++ b/Demos/StillImageHost/StillImageHost.h @@ -39,6 +39,7 @@ /* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <stdio.h>
#include "ConfigDescriptor.h"
diff --git a/Demos/TestApp/TestApp.c b/Demos/TestApp/TestApp.c index e7ee526d7..a66a728c9 100644 --- a/Demos/TestApp/TestApp.c +++ b/Demos/TestApp/TestApp.c @@ -61,7 +61,7 @@ int main(void) wdt_disable();
/* Disable clock division */
- SetSystemClockPrescaler(0);
+ clock_prescale_set(clock_div_1);
/* Hardware initialization */
SerialStream_Init(9600, false);
diff --git a/Demos/TestApp/TestApp.h b/Demos/TestApp/TestApp.h index 4175fad12..cb262397d 100644 --- a/Demos/TestApp/TestApp.h +++ b/Demos/TestApp/TestApp.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
+ #include <avr/power.h>
#include <LUFA/Version.h> // Library Version Information
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
diff --git a/Demos/USBtoSerial/USBtoSerial.c b/Demos/USBtoSerial/USBtoSerial.c index 0cef8d193..0495826b9 100644 --- a/Demos/USBtoSerial/USBtoSerial.c +++ b/Demos/USBtoSerial/USBtoSerial.c @@ -72,8 +72,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/USBtoSerial/USBtoSerial.h b/Demos/USBtoSerial/USBtoSerial.h index f363fa93f..3fb6d7d9f 100644 --- a/Demos/USBtoSerial/USBtoSerial.h +++ b/Demos/USBtoSerial/USBtoSerial.h @@ -40,6 +40,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h> + #include <avr/power.h>
#include "Descriptors.h"
#include "RingBuff.h"
diff --git a/LUFA/ChangeLog.txt b/LUFA/ChangeLog.txt index f699507dd..1a2b9f8a1 100644 --- a/LUFA/ChangeLog.txt +++ b/LUFA/ChangeLog.txt @@ -28,6 +28,7 @@ * - Mass Storage Host demo now uses a USB_STREAM_TIMEOUT_MS of two seconds to maintain compatibility with poorly designed devices
* - Function attribute ATTR_ALWAYSINLINE renamed to ATTR_ALWAYS_INLINE to match other function attribute macro naming conventions
* - Added ATTR_ALWAYS_INLINE attribute to several key inlined library components, to ensure they are inlined in all circumstances
+ * - Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions
*
* \section Sec_ChangeLog090209 Version 090209
*
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index 97e9ce931..ed2d1bc90 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -88,27 +88,6 @@ } }MACROE
/* Inline Functions: */
- /** Function for reliably setting the AVR's system clock prescaler, using inline assembly. This function
- * is guaranteed to operate reliably regardless of optimization setting or other compile time options.
- *
- * \param PrescalerMask The mask of the new prescaler setting for CLKPR
- */
- static inline void SetSystemClockPrescaler(uint8_t PrescalerMask)
- {
- uint8_t tmp = (1 << CLKPCE);
- __asm__ __volatile__ (
- "in __tmp_reg__,__SREG__" "\n\t"
- "cli" "\n\t"
- "sts %1, %0" "\n\t"
- "sts %1, %2" "\n\t"
- "out __SREG__, __tmp_reg__"
- : /* no outputs */
- : "d" (tmp),
- "M" (_SFR_MEM_ADDR(CLKPR)),
- "d" (PrescalerMask)
- : "r0");
- }
-
/** Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1,
* etc.
*
diff --git a/LUFA/MigrationInformation.txt b/LUFA/MigrationInformation.txt index ebfc364d0..364f09c3e 100644 --- a/LUFA/MigrationInformation.txt +++ b/LUFA/MigrationInformation.txt @@ -17,6 +17,8 @@ * defined in the project makefile and passed to the compiler via the -D switch.
* - The makefile EEPROM programming targets for FLIP and dfu-programmer no longer program in the FLASH data in addition to the
* EEPROM data into the device. If both are to be programmed, both the EEPROM and FLASH programming targets must be called.
+ * - As the avr-libc macro has been corrected in recent avr-libc distributions, the SetSystemClockPrescaler() macro has been removed.
+ * Include <avr/power.h> and call clock_prescale_set(clock_div_1); instead on recent avr-libc distributions.
*
* <b>Library Demos</b>
* - The USBtoSerial demo now discards all data when not connected to a host, rather than buffering it for later transmission.
diff --git a/Projects/AVRISP_Programmer/AVRISP_Programmer.c b/Projects/AVRISP_Programmer/AVRISP_Programmer.c index 9ba3c0e7e..4bc4f9cc3 100644 --- a/Projects/AVRISP_Programmer/AVRISP_Programmer.c +++ b/Projects/AVRISP_Programmer/AVRISP_Programmer.c @@ -167,8 +167,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
LEDs_Init();
diff --git a/Projects/AVRISP_Programmer/AVRISP_Programmer.h b/Projects/AVRISP_Programmer/AVRISP_Programmer.h index 4c98d6bf3..c6ac13fe7 100644 --- a/Projects/AVRISP_Programmer/AVRISP_Programmer.h +++ b/Projects/AVRISP_Programmer/AVRISP_Programmer.h @@ -37,10 +37,11 @@ #define _AVRISP_PROGRAMMER_H_
/* Includes: */
- #include <util/delay.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
+ #include <util/delay.h>
#include "Descriptors.h"
#include "RingBuff.h"
diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c index 3696c1249..2826c140e 100644 --- a/Projects/Magstripe/Magstripe.c +++ b/Projects/Magstripe/Magstripe.c @@ -93,8 +93,8 @@ int main(void) MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- SetSystemClockPrescaler(0);
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Magstripe_Init();
diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index cde2fcdc6..61f3098ea 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -41,6 +41,7 @@ #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+ #include <avr/power.h>
#include <stdbool.h>
#include <string.h>
|