diff options
| author | Keith Packard <keithp@keithp.com> | 2012-10-18 15:18:52 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-10-18 15:18:52 -0700 | 
| commit | 5a55501660ebab3b858a48483c5df1cfb4e858e4 (patch) | |
| tree | 9b5d8305d9c65b10f82f6839bb1b5c169681ef00 /src/cc1111/ao_adc.c | |
| parent | 0361235c9ef56738ba0e97be88a85afef0ce8268 (diff) | |
| parent | 440365bd17d804c2f574c35164612cf1682397d7 (diff) | |
Merge branch 'master' into mm-ms5611
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/cc1111/ao_adc.c')
| -rw-r--r-- | src/cc1111/ao_adc.c | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cc1111/ao_adc.c b/src/cc1111/ao_adc.c index f7b52281..f8000410 100644 --- a/src/cc1111/ao_adc.c +++ b/src/cc1111/ao_adc.c @@ -20,6 +20,10 @@  volatile __xdata struct ao_data	ao_data_ring[AO_DATA_RING];  volatile __data uint8_t		ao_data_head; +#ifndef AO_ADC_FIRST_PIN +#define AO_ADC_FIRST_PIN	0 +#endif +  void  ao_adc_poll(void)  { @@ -29,7 +33,7 @@ ao_adc_poll(void)  # ifdef TELENANO_V_0_1  	ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | 1;  # else -	ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | 0; +	ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | AO_ADC_FIRST_PIN;  # endif  #endif  } @@ -141,7 +145,7 @@ ao_adc_isr(void) __interrupt 1  #endif /* telemini || telenano */  #ifdef TELEFIRE_V_0_1 -	a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.sense[0] + sequence); +	a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.sense[0] + sequence - AO_ADC_FIRST_PIN);  	a[0] = ADCL;  	a[1] = ADCH;  	if (sequence < 5)  | 
