projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
219c434
)
src-avr: Run CPU at 8MHz, even with a 16MHz xtal
author
Keith Packard
<keithp@keithp.com>
Sun, 5 Jun 2011 00:58:51 +0000
(17:58 -0700)
committer
Keith Packard
<keithp@keithp.com>
Sun, 5 Jun 2011 00:58:51 +0000
(17:58 -0700)
This allows the Teensy to run at 3.3V.
Signed-off-by: Keith Packard <keithp@keithp.com>
src-avr/ao_timer.c
patch
|
blob
|
history
diff --git
a/src-avr/ao_timer.c
b/src-avr/ao_timer.c
index f0918a7d68da066064725937bf5893df65778844..aec404750f308b3d95af12f81b5da667f9666385 100644
(file)
--- 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 */