From: Keith Packard Date: Sun, 5 Jun 2011 00:58:51 +0000 (-0700) Subject: src-avr: Run CPU at 8MHz, even with a 16MHz xtal X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=e0ebdb4468db84a8e7f83043103e4b3bac928b74;p=fw%2Faltos src-avr: Run CPU at 8MHz, even with a 16MHz xtal This allows the Teensy to run at 3.3V. Signed-off-by: Keith Packard --- diff --git a/src-avr/ao_timer.c b/src-avr/ao_timer.c index f0918a7d..aec40475 100644 --- a/src-avr/ao_timer.c +++ b/src-avr/ao_timer.c @@ -140,7 +140,13 @@ ao_clock_init(void) /* Disable the clock prescaler */ cli(); CLKPR = (1 << CLKPCE); + + /* Always run the system clock at 8MHz */ +#if AVR_CLOCK > 12000000UL + CLKPR = 1; +#else CLKPR = 0; +#endif sei(); /* Set up the PLL to use the crystal */