altos: Clean up -Wextra warnings
[fw/altos] / src / stm / ao_adc_stm.c
index 18ca6ea01885770a2cb18190f3ad20c2481becff..53d4b8c3f64ece0d2e0126cbd37846de6d8fe071 100644 (file)
@@ -41,8 +41,26 @@ static uint8_t                       ao_adc_ready;
  */
 static void ao_adc_done(int index)
 {
+       (void) 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;
 }
 
@@ -92,15 +110,21 @@ static void
 ao_adc_dump(void) __reentrant
 {
        struct ao_data  packet;
-       int16_t *d;
+#ifndef AO_ADC_DUMP
        uint8_t i;
+       int16_t *d;
+#endif
 
        ao_data_get(&packet);
+#ifdef AO_ADC_DUMP
+       AO_ADC_DUMP(&packet);
+#else
        printf("tick: %5u",  packet.tick);
        d = (int16_t *) (&packet.adc);
        for (i = 0; i < AO_NUM_ADC; i++)
                printf (" %2d: %5d", i, d[i]);
        printf("\n");
+#endif
 }
 
 __code struct ao_cmds ao_adc_cmds[] = {