summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-06-04 17:58:51 -0700
committerKeith Packard <keithp@keithp.com>2011-06-04 17:58:51 -0700
commite0ebdb4468db84a8e7f83043103e4b3bac928b74 (patch)
tree2d354ae1797caa7fa00c4cafc2866529a8da8511
parent219c43463f67a942a3c842216a1f13cd3df78145 (diff)
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 <keithp@keithp.com>
-rw-r--r--src-avr/ao_timer.c6
1 files changed, 6 insertions, 0 deletions
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 */