summaryrefslogtreecommitdiff
path: root/src/ao_timer.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-02-20 20:22:16 -0800
committerKeith Packard <keithp@keithp.com>2010-02-20 20:30:27 -0800
commit84c93bb2fc4558a5e4654794ba90e730a84eaf67 (patch)
tree4d279672734ec5c3e50976917ccbf33a306a740d /src/ao_timer.c
parentfd0a42e0e96dcb8ecc9e999f70bcf70692692af9 (diff)
Change altos build process to support per-product compile-time changes
This creates per-product subdirectories and recompiles everything for each product, allowing per-product compile-time changes for things like peripheral pin assignments and attached serial devices. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_timer.c')
-rw-r--r--src/ao_timer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ao_timer.c b/src/ao_timer.c
index e81f937d..d1731475 100644
--- a/src/ao_timer.c
+++ b/src/ao_timer.c
@@ -36,24 +36,30 @@ ao_delay(uint16_t ticks)
#define T1_CLOCK_DIVISOR 8 /* 24e6/8 = 3e6 */
#define T1_SAMPLE_TIME 30000 /* 3e6/30000 = 100 */
+#if HAS_ADC
volatile __data uint8_t ao_adc_interval = 1;
volatile __data uint8_t ao_adc_count;
+#endif
void ao_timer_isr(void) interrupt 9
{
++ao_tick_count;
+#if HAS_ADC
if (++ao_adc_count == ao_adc_interval) {
ao_adc_count = 0;
ao_adc_poll();
}
+#endif
}
+#if HAS_ADC
void
ao_timer_set_adc_interval(uint8_t interval) __critical
{
ao_adc_interval = interval;
ao_adc_count = 0;
}
+#endif
void
ao_timer_init(void)