summaryrefslogtreecommitdiff
path: root/src/stm/ao_dma_stm.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-05-07 21:50:26 -0700
committerKeith Packard <keithp@keithp.com>2012-05-07 21:50:26 -0700
commitaf949c67eeb9dc310b1430d3435d241adccfc0a9 (patch)
treeb7938515ba32ca8ad5f6b7656ed38b6193991b0e /src/stm/ao_dma_stm.c
parentdd7699cf8daded17ac41abf5c5170cfb599b6ff5 (diff)
altos: stm: pass DMA buffer index to DMA completion callback
This lets the user know which DMA has finished. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_dma_stm.c')
-rw-r--r--src/stm/ao_dma_stm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stm/ao_dma_stm.c b/src/stm/ao_dma_stm.c
index e76c8e8c..8379a1a5 100644
--- a/src/stm/ao_dma_stm.c
+++ b/src/stm/ao_dma_stm.c
@@ -20,7 +20,7 @@
#define NUM_DMA 7
struct ao_dma_config {
- void (*isr)(void);
+ void (*isr)(int index);
};
uint8_t ao_dma_done[NUM_DMA];
@@ -39,7 +39,7 @@ ao_dma_isr(uint8_t index) {
/* Ack them */
stm_dma.ifcr = isr;
if (ao_dma_config[index].isr)
- (*ao_dma_config[index].isr)();
+ (*ao_dma_config[index].isr)(index);
else {
ao_dma_done[index] = 1;
ao_wakeup(&ao_dma_done[index]);
@@ -79,7 +79,7 @@ ao_dma_set_transfer(uint8_t index,
}
void
-ao_dma_set_isr(uint8_t index, void (*isr)(void))
+ao_dma_set_isr(uint8_t index, void (*isr)(int))
{
ao_dma_config[index].isr = isr;
}