Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions

pull/1469/head
Dean Camera 16 years ago
commit 4a09da2098

@ -71,8 +71,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */ /* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE); MCUCR = (1 << IVCE);

@ -41,6 +41,7 @@
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/boot.h> #include <avr/boot.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -109,8 +109,8 @@ int main (void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */ /* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE); MCUCR = (1 << IVCE);

@ -42,6 +42,7 @@
#include <avr/boot.h> #include <avr/boot.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -53,8 +53,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */ /* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE); MCUCR = (1 << IVCE);

@ -41,6 +41,7 @@
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/boot.h> #include <avr/boot.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <util/delay.h> #include <util/delay.h>
#include <stdbool.h> #include <stdbool.h>

@ -63,8 +63,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -66,8 +66,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -74,8 +74,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -35,6 +35,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include "BluetoothStack.h" #include "BluetoothStack.h"

@ -87,8 +87,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <string.h> #include <string.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -101,8 +101,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <string.h> #include <string.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -58,8 +58,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <string.h> #include <string.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -77,8 +77,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -41,6 +41,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -70,8 +70,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -41,6 +41,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -41,6 +41,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -35,6 +35,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -67,8 +67,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -35,6 +35,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -76,8 +76,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -41,6 +41,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -58,8 +58,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include "Descriptors.h" #include "Descriptors.h"

@ -68,8 +68,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "SCSI.h" #include "SCSI.h"

@ -63,8 +63,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>

@ -76,8 +76,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -69,8 +69,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -41,6 +41,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -59,8 +59,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -35,6 +35,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information

@ -74,8 +74,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -60,8 +60,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -39,9 +39,10 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/pgmspace.h>
#include <avr/power.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <avr/pgmspace.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "RNDIS.h" #include "RNDIS.h"

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <stdio.h> #include <stdio.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -61,7 +61,7 @@ int main(void)
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware initialization */ /* Hardware initialization */
SerialStream_Init(9600, false); SerialStream_Init(9600, false);

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <LUFA/Version.h> // Library Version Information #include <LUFA/Version.h> // Library Version Information
#include <LUFA/Drivers/USB/USB.h> // USB Functionality #include <LUFA/Drivers/USB/USB.h> // USB Functionality

@ -72,8 +72,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -40,6 +40,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "RingBuff.h" #include "RingBuff.h"

@ -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 * - 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 * - 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 * - 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 * \section Sec_ChangeLog090209 Version 090209
* *

@ -88,27 +88,6 @@
} }MACROE } }MACROE
/* Inline Functions: */ /* 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, /** Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1,
* etc. * etc.
* *

@ -17,6 +17,8 @@
* defined in the project makefile and passed to the compiler via the -D switch. * 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 * - 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. * 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> * <b>Library Demos</b>
* - The USBtoSerial demo now discards all data when not connected to a host, rather than buffering it for later transmission. * - The USBtoSerial demo now discards all data when not connected to a host, rather than buffering it for later transmission.

@ -167,8 +167,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -37,10 +37,11 @@
#define _AVRISP_PROGRAMMER_H_ #define _AVRISP_PROGRAMMER_H_
/* Includes: */ /* Includes: */
#include <util/delay.h>
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <util/delay.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "RingBuff.h" #include "RingBuff.h"

@ -93,8 +93,8 @@ int main(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
SetSystemClockPrescaler(0); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
Magstripe_Init(); Magstripe_Init();

@ -41,6 +41,7 @@
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

Loading…
Cancel
Save