mimxrt/dma_channel: Fix the DMA channel management.

The MIMXRT1011 has only 16 channels, so size the channel list accordingly.
This commit is contained in:
robert-hh 2021-10-03 20:54:18 +02:00 committed by Damien George
parent 101d2ddea3
commit 06d1b02014

View File

@ -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) {