mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Merge pull request #5059 from blckmn/dma_irq_fix
BUGFIX: DMA IRQ handler index incorrect
This commit is contained in:
commit
28c47ce0c9
1 changed files with 6 additions and 4 deletions
|
@ -89,8 +89,9 @@ typedef enum {
|
|||
}
|
||||
|
||||
#define DEFINE_DMA_IRQ_HANDLER(d, s, i) void DMA ## d ## _Stream ## s ## _IRQHandler(void) {\
|
||||
if (dmaDescriptors[i].irqHandlerCallback)\
|
||||
dmaDescriptors[i].irqHandlerCallback(&dmaDescriptors[i]);\
|
||||
const uint8_t index = DMA_IDENTIFIER_TO_INDEX(i); \
|
||||
if (dmaDescriptors[index].irqHandlerCallback)\
|
||||
dmaDescriptors[index].irqHandlerCallback(&dmaDescriptors[index]);\
|
||||
}
|
||||
|
||||
#define DMA_CLEAR_FLAG(d, flag) if (d->flagsShift > 31) d->dma->HIFCR = (flag << (d->flagsShift - 32)); else d->dma->LIFCR = (flag << d->flagsShift)
|
||||
|
@ -149,8 +150,9 @@ typedef enum {
|
|||
}
|
||||
|
||||
#define DEFINE_DMA_IRQ_HANDLER(d, c, i) void DMA ## d ## _Channel ## c ## _IRQHandler(void) {\
|
||||
if (dmaDescriptors[i].irqHandlerCallback)\
|
||||
dmaDescriptors[i].irqHandlerCallback(&dmaDescriptors[i]);\
|
||||
const uint8_t index = DMA_IDENTIFIER_TO_INDEX(i); \
|
||||
if (dmaDescriptors[index].irqHandlerCallback)\
|
||||
dmaDescriptors[index].irqHandlerCallback(&dmaDescriptors[index]);\
|
||||
}
|
||||
|
||||
#define DMA_CLEAR_FLAG(d, flag) d->dma->IFCR = (flag << d->flagsShift)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue