From 84c93bb2fc4558a5e4654794ba90e730a84eaf67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 20 Feb 2010 20:22:16 -0800 Subject: 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 --- src/ao_timer.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ao_timer.c') 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) -- cgit v1.2.3