Skip to content

Commit b51dc87

Browse files
committed
Added error messages when USB chip is unknown or clock rate is not supported
1 parent 5456707 commit b51dc87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hardware/arduino/cores/arduino/USBCore.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,8 @@ static inline void USB_ClockEnable()
634634
PLLCSR |= (1<<PINDIV); // Need 16 MHz xtal
635635
#elif F_CPU == 8000000UL
636636
PLLCSR &= ~(1<<PINDIV); // Need 8 MHz xtal
637+
#else
638+
#error "Clock rate of F_CPU not supported"
637639
#endif
638640

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

0 commit comments

Comments
 (0)