Skip to content

Commit

Permalink
drivers: dma: stm32u5: use correct tables for data width
Browse files Browse the repository at this point in the history
The tables for the dest and src data width constants were incorrectly
swapped. This commit uses the correct constants and renames the tables.

This change is only cosmetic for the stm32u5 since these constants are
the same but the existing names were probably inherited from another
driver where the p_*/m_* prefix was more appropriate.

Signed-off-by: Brett Witherspoon <[email protected]>
  • Loading branch information
bwitherspoon authored and carlescufi committed Jul 11, 2023
1 parent f629f2c commit 6d9d44e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/dma/dma_stm32u5.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ LOG_MODULE_REGISTER(dma_stm32, CONFIG_DMA_LOG_LEVEL);

#define DT_DRV_COMPAT st_stm32u5_dma

static const uint32_t table_m_size[] = {
static const uint32_t table_src_size[] = {
LL_DMA_SRC_DATAWIDTH_BYTE,
LL_DMA_SRC_DATAWIDTH_HALFWORD,
LL_DMA_SRC_DATAWIDTH_WORD,
};

static const uint32_t table_p_size[] = {
static const uint32_t table_dst_size[] = {
LL_DMA_DEST_DATAWIDTH_BYTE,
LL_DMA_DEST_DATAWIDTH_HALFWORD,
LL_DMA_DEST_DATAWIDTH_WORD,
Expand Down Expand Up @@ -489,10 +489,10 @@ static int dma_stm32_configure(const struct device *dev,
/* Set the data width, when source_data_size equals dest_data_size */
int index = find_lsb_set(config->source_data_size) - 1;

DMA_InitStruct.SrcDataWidth = table_p_size[index];
DMA_InitStruct.SrcDataWidth = table_src_size[index];

index = find_lsb_set(config->dest_data_size) - 1;
DMA_InitStruct.DestDataWidth = table_m_size[index];
DMA_InitStruct.DestDataWidth = table_dst_size[index];

if (stream->source_periph) {
DMA_InitStruct.BlkDataLength = config->head_block->block_size /
Expand Down

0 comments on commit 6d9d44e

Please sign in to comment.