Skip to content

Commit

Permalink
DMA: Fix non-working DMA interrupts.
Browse files Browse the repository at this point in the history
libmaple/dma.c defines DMA interrupts __irq_dma_channel[1-7],
consistent with what is specified by support/ld/names.inc.  However,
names.inc is inconsistent with what support/ld/libcs3_stm32_src/
expects.  Specifically, it contradicts the files

- support/ld/libcs3_stm32_src/stm32_isrs.S
- support/ld/libcs3_stm32_src/stm32_vector_table.S

Which use the names __irq_dma1_channel[1-7].

Change names.inc and dma.c to use the correct IRQ names.

The original names.inc/libcs3_stm32_src inconsistency was introduced
in 43d6921, but dma.c had the correct
names until ec3cf29, where they were
renamed for consistency with names.inc.  At that point, DMA interrupts
stopped working.  (This was documented in the commit message).

Thanks to forum user robodude666 for tracking this down.
  • Loading branch information
Marti Bolivar committed Jun 20, 2011
1 parent 15fce71 commit f99e031
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions libmaple/dma.c
Expand Up @@ -331,31 +331,31 @@ static inline void dispatch_handler(dma_dev *dev, dma_channel channel) {
}
}

void __irq_dma_channel1(void) {
void __irq_dma1_channel1(void) {
dispatch_handler(DMA1, DMA_CH1);
}

void __irq_dma_channel2(void) {
void __irq_dma1_channel2(void) {
dispatch_handler(DMA1, DMA_CH2);
}

void __irq_dma_channel3(void) {
void __irq_dma1_channel3(void) {
dispatch_handler(DMA1, DMA_CH3);
}

void __irq_dma_channel4(void) {
void __irq_dma1_channel4(void) {
dispatch_handler(DMA1, DMA_CH4);
}

void __irq_dma_channel5(void) {
void __irq_dma1_channel5(void) {
dispatch_handler(DMA1, DMA_CH5);
}

void __irq_dma_channel6(void) {
void __irq_dma1_channel6(void) {
dispatch_handler(DMA1, DMA_CH6);
}

void __irq_dma_channel7(void) {
void __irq_dma1_channel7(void) {
dispatch_handler(DMA1, DMA_CH7);
}

Expand Down
14 changes: 7 additions & 7 deletions support/ld/names.inc
Expand Up @@ -26,13 +26,13 @@ EXTERN(__irq_exti1)
EXTERN(__irq_exti2)
EXTERN(__irq_exti3)
EXTERN(__irq_exti4)
EXTERN(__irq_dma_channel1)
EXTERN(__irq_dma_channel2)
EXTERN(__irq_dma_channel3)
EXTERN(__irq_dma_channel4)
EXTERN(__irq_dma_channel5)
EXTERN(__irq_dma_channel6)
EXTERN(__irq_dma_channel7)
EXTERN(__irq_dma1_channel1)
EXTERN(__irq_dma1_channel2)
EXTERN(__irq_dma1_channel3)
EXTERN(__irq_dma1_channel4)
EXTERN(__irq_dma1_channel5)
EXTERN(__irq_dma1_channel6)
EXTERN(__irq_dma1_channel7)
EXTERN(__irq_adc)
EXTERN(__irq_usb_hp_can_tx)
EXTERN(__irq_usb_lp_can_rx0)
Expand Down

0 comments on commit f99e031

Please sign in to comment.