summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-05-27 17:29:27 -0600
committerKeith Packard <keithp@keithp.com>2012-05-27 17:29:27 -0600
commit627b904b36e129ff2ead436a626699abfc3b3211 (patch)
tree665d2101274eb726c8d5772112ae1ed3b4263215 /src
parent090dc9aecdf4cfd1ac727325ae141d441c5b28aa (diff)
altos: Make stm-demo compile with new ao_data structure
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/stm-demo/ao_demo.c8
-rw-r--r--src/stm-demo/ao_pins.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c
index 7bb53047..232c2313 100644
--- a/src/stm-demo/ao_demo.c
+++ b/src/stm-demo/ao_demo.c
@@ -119,7 +119,7 @@ ao_i2c_write(void) {
for (i = 0; i < 10; i++) {
ao_i2c_get(0);
if (ao_i2c_start(0, 0x55))
- ao_i2c_send(data, 4, 0);
+ ao_i2c_send(data, 4, 0, TRUE);
else {
printf ("i2c start failed\n");
ao_i2c_put(0);
@@ -135,16 +135,16 @@ ao_i2c_write(void) {
static void
ao_temp (void)
{
- struct ao_adc adc;
+ struct ao_data packet;
int temp;
- ao_adc_get(&adc);
+ ao_data_get(&packet);
/*
* r = (110 - 25) / (ts_cal_hot - ts_cal_cold)
* 25 + (110 - 25) * (temp - ts_cal_cold) / (ts_cal_hot - ts_cal_cold)
*/
- temp = 25 + (110 - 25) * (adc.temp - stm_temp_cal.ts_cal_cold) / (stm_temp_cal.ts_cal_hot - stm_temp_cal.ts_cal_cold);
+ temp = 25 + (110 - 25) * (packet.adc.temp - stm_temp_cal.ts_cal_cold) / (stm_temp_cal.ts_cal_hot - stm_temp_cal.ts_cal_cold);
printf ("temp: %d\n", temp);
}
diff --git a/src/stm-demo/ao_pins.h b/src/stm-demo/ao_pins.h
index 1daab351..d02c071c 100644
--- a/src/stm-demo/ao_pins.h
+++ b/src/stm-demo/ao_pins.h
@@ -156,6 +156,7 @@ struct ao_adc {
#define HAS_ADC_TEMP 1
+#define AO_DATA_RING 32
#define AO_NUM_ADC 3
#define AO_ADC_SQ1 AO_ADC_IDD