summaryrefslogtreecommitdiff
path: root/src/telemini-v2.0
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-08-26 16:41:33 -0700
committerKeith Packard <keithp@keithp.com>2013-08-26 16:41:33 -0700
commit2380a4b9bd69629c78eec0a87ff8681a0524d8d2 (patch)
treed89ec47ef3a674a9150d0ff2af6e1fe51c9de8bc /src/telemini-v2.0
parentaeb1c8a2aa533cb2805f0dbe848e098c8cae2b39 (diff)
cc1111: Rework ADC configuration a bit, fix Tm V2 ADC usage
The Tm v2 ADC code was not actually fetching and storing the ADC conversion values. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/telemini-v2.0')
-rw-r--r--src/telemini-v2.0/ao_pins.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/telemini-v2.0/ao_pins.h b/src/telemini-v2.0/ao_pins.h
index 9ecd076e..fac6c535 100644
--- a/src/telemini-v2.0/ao_pins.h
+++ b/src/telemini-v2.0/ao_pins.h
@@ -31,7 +31,6 @@
#define USE_INTERNAL_FLASH 0
#define HAS_DBG 0
#define PACKET_HAS_SLAVE 1
-#define USE_FAST_ASCENT_LOG 1
#define AO_LED_GREEN 1
#define AO_LED_RED 2
@@ -127,6 +126,8 @@ struct ao_adc {
printf("tick: %5u apogee: %5d main: %5d batt: %5d\n", \
(p)->tick, (p)->adc.sense_a, (p)->adc.sense_m, (p)->adc.v_batt)
+#define AO_ADC_PINS ((1 << 0) | (1 << 1) | (1 << 4))
+
#define FETCH_ADC() \
a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc); \
switch (sequence) { \
@@ -142,7 +143,11 @@ struct ao_adc {
sequence = 1; \
break; \
} \
- if (sequence) \
- ;
+ a[0] = ADCL; \
+ a[1] = ADCH; \
+ if (sequence) { \
+ ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | sequence; \
+ return; \
+ }
#endif /* _AO_PINS_H_ */