Browse Source

Update DMAChannel.h

Allow specific interrupt level for DMA ISR.
main
WMXZ-EU 4 years ago
parent
commit
7118ab94af
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      teensy4/DMAChannel.h

+ 6
- 0
teensy4/DMAChannel.h View File

@@ -535,6 +535,12 @@ public:
NVIC_ENABLE_IRQ(IRQ_DMA_CH0 + channel);
}

void attachInterrupt(void (*isr)(void), uint8_t prio) {
_VectorsRam[channel + IRQ_DMA_CH0 + 16] = isr;
NVIC_ENABLE_IRQ(IRQ_DMA_CH0 + channel);
NVIC_SET_PRIORITY(IRQ_DMA_CH0 + channel, prio);
}
void detachInterrupt(void) {
NVIC_DISABLE_IRQ(IRQ_DMA_CH0 + channel);
}

Loading…
Cancel
Save