mirror of https://github.com/noisymime/Arduino.git
Updating USB core to work at 8 MHz (different PLLCSR value).
This commit is contained in:
parent
9a13d211ba
commit
7e12aebbdb
|
@ -638,7 +638,11 @@ void USBDevice_::attach()
|
||||||
_usbConfiguration = 0;
|
_usbConfiguration = 0;
|
||||||
UHWCON = 0x01; // power internal reg
|
UHWCON = 0x01; // power internal reg
|
||||||
USBCON = (1<<USBE)|(1<<FRZCLK); // clock frozen, usb enabled
|
USBCON = (1<<USBE)|(1<<FRZCLK); // clock frozen, usb enabled
|
||||||
|
#if F_CPU == 16000000UL
|
||||||
PLLCSR = 0x12; // Need 16 MHz xtal
|
PLLCSR = 0x12; // Need 16 MHz xtal
|
||||||
|
#elif F_CPU == 8000000UL
|
||||||
|
PLLCSR = 0x02; // Need 8 MHz xtal
|
||||||
|
#endif
|
||||||
while (!(PLLCSR & (1<<PLOCK))) // wait for lock pll
|
while (!(PLLCSR & (1<<PLOCK))) // wait for lock pll
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue