summaryrefslogtreecommitdiff
path: root/src/stm/ao_adc_stm.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-04-09 00:05:18 -0700
committerKeith Packard <keithp@keithp.com>2012-04-09 00:05:18 -0700
commit059f09dbca4703c25b42389b54c6510331c39485 (patch)
tree2221695d0bd96527a162be7e4b2520811f2c25ab /src/stm/ao_adc_stm.c
parentf7cfbbce2b94b5ac0094a0e34e1766fe1ceb12c8 (diff)
altos: Allow STM DMA channels to be reserved for one use
This allows a single user of a DMA channel to reserve it for use without needing to lock the mutex; this is required for DMA from the ADC to work on megametrum as it wants to start DMA from an interrupt handler, which cannot block on a mutex. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stm/ao_adc_stm.c b/src/stm/ao_adc_stm.c
index d758e629..729551c4 100644
--- a/src/stm/ao_adc_stm.c
+++ b/src/stm/ao_adc_stm.c
@@ -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]);
}