X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fcc1111%2Fao_adc.c;h=f80004104130c324c19cd4e68884edc4b5a208a4;hp=f7b52281ae799855008bdcb1d296779e23e5024e;hb=3f059f8878a79b3154a19b6803fbc367eda80dc9;hpb=583458772746317b98fced907ec780edff465888 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)