diff options
| author | Bdale Garbee <bdale@gag.com> | 2013-05-16 00:36:23 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2013-05-16 00:36:23 -0600 | 
| commit | 02d111b1b53ef01fc6e9ab6c4bc60b8af1be0067 (patch) | |
| tree | 8356f4a019969ee99a45e264c87d38555cf316cc /src/cc1111/ao_adc.c | |
| parent | 7a2e1f05adad990a6b161865267abf07ffec7a7e (diff) | |
| parent | 7699a55aed3a9a7daeb4c6a5a9a280f43edf455f (diff) | |
Merge branch 'branch-1.2' into debian
Diffstat (limited to 'src/cc1111/ao_adc.c')
| -rw-r--r-- | src/cc1111/ao_adc.c | 19 | 
1 files changed, 16 insertions, 3 deletions
diff --git a/src/cc1111/ao_adc.c b/src/cc1111/ao_adc.c index f7b52281..ed76179b 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  } @@ -52,7 +56,7 @@ ao_adc_isr(void) __interrupt 1  	uint8_t	__xdata *a;  	sequence = (ADCCON2 & ADCCON2_SCH_MASK) >> ADCCON2_SCH_SHIFT; -#if TELEMETRUM_V_0_1 || TELEMETRUM_V_0_2 || TELEMETRUM_V_1_0 || TELEMETRUM_V_1_1 || TELEMETRUM_V_1_2 || TELELAUNCH_V_0_1 +#if TELEMETRUM_V_0_1 || TELEMETRUM_V_0_2 || TELEMETRUM_V_1_0 || TELEMETRUM_V_1_1 || TELEMETRUM_V_1_2 || TELELAUNCH_V_0_1 || TELEBALLOON_V_1_1  	/* TeleMetrum readings */  #if HAS_ACCEL_REF  	if (sequence == 2) { @@ -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) @@ -149,6 +153,15 @@ ao_adc_isr(void) __interrupt 1  #define GOT_ADC  #endif /* TELEFIRE_V_0_1 */ +#ifdef TELEBT_V_1_0 +	a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.batt); +	a[0] = ADCL; +	a[1] = ADCH; +	if (0) +		; +#define GOT_ADC +#endif	 +  #ifndef GOT_ADC  #error No known ADC configuration set  #endif  | 
