Skip to content

Commit

Permalink
Fix esp-idf v5.3 compilation error with esp32p4
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo authored Jul 26, 2024
1 parent 25d9a0f commit e9b623e
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions src/lgfx/v1/platforms/esp32/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,31 @@ Original Source:
#endif

#if defined (SOC_GDMA_SUPPORTED) // for C3/S3
#include <soc/gdma_reg.h>
#include <soc/gdma_struct.h>
// S3とC3で同じレジスタに異なる定義名がついているため、ここで統一;
#if !defined (DMA_OUT_PERI_SEL_CH0_REG)
#define DMA_OUT_PERI_SEL_CH0_REG GDMA_OUT_PERI_SEL_CH0_REG
#if __has_include(<soc/gdma_reg.h>)
#include <soc/gdma_reg.h>
#elif __has_include(<soc/axi_dma_reg.h>) // ESP32P4
#include <soc/axi_dma_reg.h>
#endif
#if !defined (DMA_IN_PERI_SEL_CH0_REG)
#define DMA_IN_PERI_SEL_CH0_REG GDMA_IN_PERI_SEL_CH0_REG
#if __has_include(<soc/gdma_struct.h>)
#include <soc/gdma_struct.h>
#elif __has_include(<soc/axi_dma_struct.h>) // ESP32P4
#include <soc/axi_dma_struct.h>
#endif
#if defined ( CONFIG_IDF_TARGET_ESP32P4 )
#define DMA_OUT_PERI_SEL_CH0_REG AXI_DMA_OUT_PERI_SEL_CH0_REG
#define DMA_IN_PERI_SEL_CH0_REG AXI_DMA_IN_PERI_SEL_CH0_REG
#else
// S3とC3で同じレジスタに異なる定義名がついているため、ここで統一;
#if !defined (DMA_OUT_PERI_SEL_CH0_REG)
#define DMA_OUT_PERI_SEL_CH0_REG GDMA_OUT_PERI_SEL_CH0_REG
#endif
#if !defined (DMA_IN_PERI_SEL_CH0_REG)
#define DMA_IN_PERI_SEL_CH0_REG GDMA_IN_PERI_SEL_CH0_REG
#endif

#if !defined (SOC_GDMA_PAIRS_PER_GROUP_MAX)
#define SOC_GDMA_PAIRS_PER_GROUP_MAX SOC_GDMA_PAIRS_PER_GROUP
#if !defined (SOC_GDMA_PAIRS_PER_GROUP_MAX)
#define SOC_GDMA_PAIRS_PER_GROUP_MAX SOC_GDMA_PAIRS_PER_GROUP
#endif
#endif
#endif

Expand Down

0 comments on commit e9b623e

Please sign in to comment.