Skip to content

fix for issue #1295 "leonardo as keyboard does not wake windows 7 from sleep" #1488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Added error messages when USB chip is unknown or clock rate is not su…
…pported
  • Loading branch information
nospam2000 committed Jul 14, 2013
commit b51dc879bc71eecda4647536b7499a2e6fd18f8d
6 changes: 5 additions & 1 deletion hardware/arduino/cores/arduino/USBCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,8 @@ static inline void USB_ClockEnable()
PLLCSR |= (1<<PINDIV); // Need 16 MHz xtal
#elif F_CPU == 8000000UL
PLLCSR &= ~(1<<PINDIV); // Need 8 MHz xtal
#else
#error "Clock rate of F_CPU not supported"
#endif

// AT90USB646, AT90USB647, AT90USB1286, AT90USB1287
Expand All @@ -646,11 +648,13 @@ static inline void USB_ClockEnable()
// For AT90USB64x only. Do not use with AT90USB128x.
PLLCSR = (PLLCSR & ~(1<<PLLP0)) | ((1<<PLLP2) | (1<<PLLP1)); // Need 16 MHz xtal
#else
#error "USB Chip not supported, please defined method of PLL initialization yourself"
#error "USB Chip not supported, please defined method of USB PLL initialization"
#endif
#elif F_CPU == 8000000UL
// for Atmel AT90USB128x and AT90USB64x
PLLCSR = (PLLCSR & ~(1<<PLLP2)) | ((1<<PLLP1) | (1<<PLLP0)); // Need 8 MHz xtal
#else
#error "Clock rate of F_CPU not supported"
#endif
#endif

Expand Down