Skip to content

Commit

Permalink
Backport F_CPU/F_USB hack from system76 (qmk#14286)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan <[email protected]>
  • Loading branch information
drashna and fauxpark authored Sep 9, 2021
1 parent cb4006c commit 6d43a5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tmk_core/protocol/lufa/lufa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,13 @@ static void setup_mcu(void) {
MCUSR &= ~_BV(WDRF);
wdt_disable();

/* Disable clock division */
// For boards running 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
Expand Down

0 comments on commit 6d43a5d

Please sign in to comment.