Sfoglia il codice sorgente

Use DMA_NUM_CHANNELS for index if allocation fails

teensy4-core
PaulStoffregen 10 anni fa
parent
commit
7f9688e5a3
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      teensy3/DMAChannel.cpp

+ 1
- 1
teensy3/DMAChannel.cpp Vedi File

@@ -17,7 +17,7 @@ void DMAChannel::init(void)
if (++ch >= DMA_NUM_CHANNELS) {
__enable_irq();
TCD = (TCD_t *)0;
channel = 16;
channel = DMA_NUM_CHANNELS;
return; // no more channels available
// attempts to use this object will hardfault
}

Loading…
Annulla
Salva