diff options
author | Keith Packard <keithp@keithp.com> | 2012-10-08 23:04:16 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-08 23:04:16 -0700 |
commit | 39c5738acdfdf0c87b64de6135fe107971cfa12b (patch) | |
tree | 067882f873e36200f38fde4805600b6f10e68a78 /src/stm/ao_adc_stm.c | |
parent | 16bbe9d25856259d2694751c364b668638e4a971 (diff) |
altos: Go back to recording sensor data in globalsmm-ms5611
Instead of trying to get things into the ring from a variety of
functions, go back to the simpler method of storing them in globals
and having the ADC code just pluck out the most recent values.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_adc_stm.c')
-rw-r--r-- | src/stm/ao_adc_stm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/stm/ao_adc_stm.c b/src/stm/ao_adc_stm.c index 18ca6ea0..48fc4262 100644 --- a/src/stm/ao_adc_stm.c +++ b/src/stm/ao_adc_stm.c @@ -43,6 +43,23 @@ static void ao_adc_done(int index) { AO_DATA_PRESENT(AO_DATA_ADC); ao_dma_done_transfer(STM_DMA_INDEX(STM_DMA_CHANNEL_ADC1)); + if (ao_data_present == AO_DATA_ALL) { +#if HAS_MS5607 + ao_data_ring[ao_data_head].ms5607_raw = ao_ms5607_current; +#endif +#if HAS_MMA655X + ao_data_ring[ao_data_head].mma655x = ao_mma655x_current; +#endif +#if HAS_HMC5883 + ao_data_ring[ao_data_head].hmc5883 = ao_hmc5883_current; +#endif +#if HAS_MPU6000 + ao_data_ring[ao_data_head].mpu6000 = ao_mpu6000_current; +#endif + ao_data_ring[ao_data_head].tick = ao_tick_count; + ao_data_head = ao_data_ring_next(ao_data_head); + ao_wakeup((void *) &ao_data_head); + } ao_adc_ready = 1; } |