summaryrefslogtreecommitdiff
path: root/src-avr/ao_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src-avr/ao_timer.c')
-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 */