diff options
| author | Bdale Garbee <bdale@gag.com> | 2012-08-28 23:39:53 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2012-08-28 23:39:53 -0600 | 
| commit | 5ed88fb72c3e3ecf3333c700d838667db71cfbdc (patch) | |
| tree | 3b371f563c0f7607f2fe53242673adb352b48514 /src/stm/ao_timer.c | |
| parent | adbe64c5a9402b7c5075a444a12629131b663877 (diff) | |
| parent | 621d0930244f25165d2ac5da596dcc87e253b965 (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Conflicts:
	debian/control
Diffstat (limited to 'src/stm/ao_timer.c')
| -rw-r--r-- | src/stm/ao_timer.c | 21 | 
1 files changed, 12 insertions, 9 deletions
| diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c index ebe75366..78228e65 100644 --- a/src/stm/ao_timer.c +++ b/src/stm/ao_timer.c @@ -17,7 +17,7 @@  #include "ao.h" -volatile __data uint16_t ao_tick_count; +volatile __data AO_TICK_TYPE ao_tick_count;  uint16_t ao_time(void)  { @@ -37,9 +37,9 @@ ao_delay(uint16_t ticks)  	ao_sleep(&ao_forever);  } -#if HAS_ADC -volatile __data uint8_t	ao_adc_interval = 1; -volatile __data uint8_t	ao_adc_count; +#if AO_DATA_ALL +volatile __data uint8_t	ao_data_interval = 1; +volatile __data uint8_t	ao_data_count;  #endif  void @@ -51,10 +51,13 @@ void stm_tim6_isr(void)  	if (stm_tim6.sr & (1 << STM_TIM67_SR_UIF)) {  		stm_tim6.sr = 0;  		++ao_tick_count; -#if HAS_ADC -		if (++ao_adc_count == ao_adc_interval) { -			ao_adc_count = 0; +#if AO_DATA_ALL +		if (++ao_data_count == ao_data_interval) { +			ao_data_count = 0;  			ao_adc_poll(); +#if (AO_DATA_ALL & ~(AO_DATA_ADC)) +			ao_wakeup((void *) &ao_data_count); +#endif  		}  #endif  	} @@ -64,8 +67,8 @@ void stm_tim6_isr(void)  void  ao_timer_set_adc_interval(uint8_t interval) __critical  { -	ao_adc_interval = interval; -	ao_adc_count = 0; +	ao_data_interval = interval; +	ao_data_count = 0;  }  #endif | 
