altos: stm: pass DMA buffer index to DMA completion callback
[fw/altos] / src / stm / ao_adc_stm.c
index d758e629bac7461eae6ed52097f19e6d78afb620..a256990851f3bfeb5af3c2e2e79b53f7a64a3f4d 100644 (file)
@@ -41,7 +41,7 @@ static uint8_t                        ao_adc_ready;
  *
  * Mark time in ring, shut down DMA engine
  */
-static void ao_adc_done(void)
+static void ao_adc_done(int index)
 {
        ao_adc_ring[ao_adc_head].tick = ao_time();
        ao_adc_head = ao_adc_ring_next(ao_adc_head);
@@ -221,5 +221,7 @@ ao_adc_init(void)
        /* Clear any stale status bits */
        stm_adc.sr = 0;
        ao_adc_ready = 1;
+
+       ao_dma_alloc(STM_DMA_INDEX(STM_DMA_CHANNEL_ADC1));
        ao_cmd_register(&ao_adc_cmds[0]);
 }