projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Call ao_task_init before initializing any drivers
[fw/altos]
/
src
/
stm
/
ao_dma_stm.c
diff --git
a/src/stm/ao_dma_stm.c
b/src/stm/ao_dma_stm.c
index 21390748b86dae82eddaec7e2662be60e38aa6a2..8379a1a533ca0ec5e19321910b1a9975a952f744 100644
(file)
--- 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 {
#define NUM_DMA 7
struct ao_dma_config {
- void (*isr)(
void
);
+ void (*isr)(
int index
);
};
uint8_t ao_dma_done[NUM_DMA];
};
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)
/* 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]);
else {
ao_dma_done[index] = 1;
ao_wakeup(&ao_dma_done[index]);
@@
-79,7
+79,7
@@
ao_dma_set_transfer(uint8_t index,
}
void
}
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;
}
{
ao_dma_config[index].isr = isr;
}
@@
-109,6
+109,7
@@
void
ao_dma_abort(uint8_t index)
{
stm_dma.channel[index].ccr &= ~(1 << STM_DMA_CCR_EN);
ao_dma_abort(uint8_t index)
{
stm_dma.channel[index].ccr &= ~(1 << STM_DMA_CCR_EN);
+ ao_wakeup(&ao_dma_done[index]);
}
void
}
void