From 25d9a0f86e6edf84e9393d8dd9d8bca96ab850e0 Mon Sep 17 00:00:00 2001 From: tobozo Date: Fri, 26 Jul 2024 09:21:44 +0200 Subject: [PATCH] Fix esp-idf v5.3 compilation error with esp32p4 --- src/lgfx/v1/platforms/esp32/Bus_SPI.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp b/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp index 0aa28d69..db885545 100644 --- a/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp +++ b/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp @@ -79,14 +79,21 @@ Original Source: #elif __has_include() // ESP32P4 #include #endif - #if !defined DMA_OUT_LINK_CH0_REG - #define DMA_OUT_LINK_CH0_REG GDMA_OUT_LINK_CH0_REG - #define DMA_OUTFIFO_STATUS_CH0_REG GDMA_OUTFIFO_STATUS_CH0_REG - #define DMA_OUTLINK_START_CH0 GDMA_OUTLINK_START_CH0 - #if defined (GDMA_OUTFIFO_EMPTY_L3_CH0) - #define DMA_OUTFIFO_EMPTY_CH0 GDMA_OUTFIFO_EMPTY_L3_CH0 - #else - #define DMA_OUTFIFO_EMPTY_CH0 GDMA_OUTFIFO_EMPTY_CH0 + #if defined ( CONFIG_IDF_TARGET_ESP32P4 ) + #define DMA_OUT_LINK_CH0_REG AXI_DMA_OUT_LINK1_CH0_REG + #define DMA_OUTFIFO_STATUS_CH0_REG AXI_DMA_OUTFIFO_STATUS_CH0_REG + #define DMA_OUTLINK_START_CH0 AXI_DMA_OUTLINK_START_CH0 + #define DMA_OUTFIFO_EMPTY_CH0 AXI_DMA_OUTFIFO_L3_EMPTY_CH0 + #else + #if !defined DMA_OUT_LINK_CH0_REG + #define DMA_OUT_LINK_CH0_REG GDMA_OUT_LINK_CH0_REG + #define DMA_OUTFIFO_STATUS_CH0_REG GDMA_OUTFIFO_STATUS_CH0_REG + #define DMA_OUTLINK_START_CH0 GDMA_OUTLINK_START_CH0 + #if defined (GDMA_OUTFIFO_EMPTY_L3_CH0) + #define DMA_OUTFIFO_EMPTY_CH0 GDMA_OUTFIFO_EMPTY_L3_CH0 + #else + #define DMA_OUTFIFO_EMPTY_CH0 GDMA_OUTFIFO_EMPTY_CH0 + #endif #endif #endif #endif