mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-01-19 08:05:01 +00:00
Reduce AVR clock to 8MHz
This commit is contained in:
parent
ac59886d3f
commit
84a11e746f
@ -4,8 +4,10 @@ MCU = atmega32u4
|
||||
# Allow flashing with usbasp
|
||||
AVRDUDE_MCU = $(MCU)
|
||||
|
||||
# Processor frequency
|
||||
F_CPU = 16000000
|
||||
# CPU frequency divided by two since AVR is at 3.3V
|
||||
F_CPU = 8000000
|
||||
# External oscillator is 16Mhz
|
||||
F_USB = 16000000
|
||||
|
||||
# Bootloader selection
|
||||
# Teensy halfkay
|
||||
|
@ -917,8 +917,14 @@ static void setup_mcu(void) {
|
||||
MCUSR &= ~_BV(WDRF);
|
||||
wdt_disable();
|
||||
|
||||
// HACK for System76 boards with AVR at 3.3V and crystal at 16 MHz
|
||||
#if (F_CPU == 8000000 && F_USB == 16000000)
|
||||
/* Divide clock by 2 */
|
||||
clock_prescale_set(clock_div_2);
|
||||
#else
|
||||
/* Disable clock division */
|
||||
clock_prescale_set(clock_div_1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** \brief Setup USB
|
||||
|
Loading…
Reference in New Issue
Block a user