瀏覽代碼

Use DMA_NUM_CHANNELS for index if allocation fails

teensy4-core
PaulStoffregen 10 年之前
父節點
當前提交
7f9688e5a3
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      teensy3/DMAChannel.cpp

+ 1
- 1
teensy3/DMAChannel.cpp 查看文件

@@ -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…
取消
儲存