Added error messages when USB chip is unknown or clock rate is not supported

pull/18/head
Michael Dreher 12 years ago committed by Jesse Vincent
parent d2d1d1b4a6
commit 3d1c120d53

@ -634,6 +634,8 @@ static inline void USB_ClockEnable()
PLLCSR |= (1<<PINDIV); // Need 16 MHz xtal PLLCSR |= (1<<PINDIV); // Need 16 MHz xtal
#elif F_CPU == 8000000UL #elif F_CPU == 8000000UL
PLLCSR &= ~(1<<PINDIV); // Need 8 MHz xtal PLLCSR &= ~(1<<PINDIV); // Need 8 MHz xtal
#else
#error "Clock rate of F_CPU not supported"
#endif #endif
// AT90USB646, AT90USB647, AT90USB1286, AT90USB1287 // AT90USB646, AT90USB647, AT90USB1286, AT90USB1287
@ -646,11 +648,13 @@ static inline void USB_ClockEnable()
// For AT90USB64x only. Do not use with AT90USB128x. // For AT90USB64x only. Do not use with AT90USB128x.
PLLCSR = (PLLCSR & ~(1<<PLLP0)) | ((1<<PLLP2) | (1<<PLLP1)); // Need 16 MHz xtal PLLCSR = (PLLCSR & ~(1<<PLLP0)) | ((1<<PLLP2) | (1<<PLLP1)); // Need 16 MHz xtal
#else #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 #endif
#elif F_CPU == 8000000UL #elif F_CPU == 8000000UL
// for Atmel AT90USB128x and AT90USB64x // for Atmel AT90USB128x and AT90USB64x
PLLCSR = (PLLCSR & ~(1<<PLLP2)) | ((1<<PLLP1) | (1<<PLLP0)); // Need 8 MHz xtal PLLCSR = (PLLCSR & ~(1<<PLLP2)) | ((1<<PLLP1) | (1<<PLLP0)); // Need 8 MHz xtal
#else
#error "Clock rate of F_CPU not supported"
#endif #endif
#endif #endif

Loading…
Cancel
Save