volatile __data uint8_t ao_adc_count;
#endif
+void
+ao_debug_out(char c);
+
#ifdef AVR
ISR(TIMER1_COMPA_vect)
#else
/* 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 */
(0x4 << PDIV0)); /* 48MHz PLL clock */
/* Set the frequency of the crystal */
-#if TEENSY
+#if AVR_CLOCK > 12000000UL
PLLCSR |= (1 << PINDIV); /* For 16MHz crystal on Teensy board */
#else
PLLCSR &= ~(1 << PINDIV); /* For 8MHz crystal on TeleScience board */
PLLCSR |= (1 << PLLE);
while (!(PLLCSR & (1 << PLOCK)))
;
+
+ set_sleep_mode(SLEEP_MODE_IDLE);
+ sleep_enable();
#else
/* Switch system clock to crystal oscilator */
CLKCON = (CLKCON & ~CLKCON_OSC_MASK) | (CLKCON_OSC_XTAL);