diff options
| author | Bdale Garbee <bdale@gag.com> | 2012-10-23 09:38:36 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2012-10-23 09:38:36 -0600 | 
| commit | 055f3232decc07e064d596469b81cf9869411c2d (patch) | |
| tree | cc5ebf8283ca00cbe1344f6ed808feaf7e9575ad /src/avr/ao_adc_avr.c | |
| parent | 8ca58e20208495ce63b8256a8ffa43932867e8d5 (diff) | |
| parent | 9e60fa214ad2c48fbe8f7e5c437681aa35d249fa (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'src/avr/ao_adc_avr.c')
| -rw-r--r-- | src/avr/ao_adc_avr.c | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/src/avr/ao_adc_avr.c b/src/avr/ao_adc_avr.c index 3a262977..231512b2 100644 --- a/src/avr/ao_adc_avr.c +++ b/src/avr/ao_adc_avr.c @@ -16,6 +16,7 @@   */  #include "ao.h" +#include "ao_pwmin.h"  volatile __xdata struct ao_data	ao_data_ring[AO_DATA_RING];  volatile __data uint8_t		ao_data_head; @@ -93,9 +94,13 @@ ISR(ADC_vect)  	value = ADCL;  	value |= (ADCH << 8);  	ao_data_ring[ao_data_head].adc.adc[ao_adc_channel] = value; -	if (++ao_adc_channel < NUM_ADC) +	if (++ao_adc_channel < NUM_ADC - HAS_ICP3_COUNT)  		ao_adc_start();  	else { +#if HAS_ICP3_COUNT +		/* steal last adc channel for pwm input */ +		ao_data_ring[ao_data_head].adc.adc[ao_adc_channel] = ao_icp3_count; +#endif  		ADCSRA = ADCSRA_INIT;  		ao_data_ring[ao_data_head].tick = ao_time();  		ao_data_head = ao_data_ring_next(ao_data_head); | 
