Browse Source

Use DMA_NUM_CHANNELS for index if allocation fails

teensy4-core
PaulStoffregen 10 years ago
parent
commit
7f9688e5a3
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      teensy3/DMAChannel.cpp

+ 1
- 1
teensy3/DMAChannel.cpp View File

if (++ch >= DMA_NUM_CHANNELS) { if (++ch >= DMA_NUM_CHANNELS) {
__enable_irq(); __enable_irq();
TCD = (TCD_t *)0; TCD = (TCD_t *)0;
channel = 16;
channel = DMA_NUM_CHANNELS;
return; // no more channels available return; // no more channels available
// attempts to use this object will hardfault // attempts to use this object will hardfault
} }

Loading…
Cancel
Save