Browse Source

mimxrt/dma_channel: Fix the DMA channel management.

The MIMXRT1011 has only 16 channels, so size the channel list accordingly.
pull/6774/head
robert-hh 3 years ago
committed by Damien George
parent
commit
06d1b02014
  1. 15
      ports/mimxrt/dma_channel.c

15
ports/mimxrt/dma_channel.c

@ -27,10 +27,17 @@
#include "dma_channel.h"
// List of channel flags: true: channel used, false: channel available
static bool channel_list[32] = { true, true, true, true, false, false, false, false,
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false };
static bool channel_list[FSL_FEATURE_DMAMUX_MODULE_CHANNEL] = {
true, true, true, true, false, false, false, false,
false, false, false, false, false, false, false, false,
#if FSL_FEATURE_DMAMUX_MODULE_CHANNEL > 16
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false
#endif
};
// allocate_channel(): retrieve an available channel. Return the number or -1
int allocate_dma_channel(void) {

Loading…
Cancel
Save