From 2e574025f7efd8bdd2c82b726a16a5f8eeeadf48 Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:00:49 +0900 Subject: [PATCH] fix compile error --- src/lgfx/v1/platforms/arduino_default/common.hpp | 2 +- src/lgfx/v1/platforms/esp32/common.hpp | 5 +++++ src/lgfx/v1/platforms/esp32s2/Bus_Parallel16.cpp | 4 ++++ src/lgfx/v1/platforms/esp32s2/Bus_Parallel8.cpp | 4 ++++ src/lgfx/v1/platforms/esp8266/common.hpp | 2 +- src/lgfx/v1/platforms/framebuffer/common.hpp | 2 +- src/lgfx/v1/platforms/opencv/common.hpp | 2 +- src/lgfx/v1/platforms/rp2040/common.hpp | 2 +- src/lgfx/v1/platforms/samd21/common.hpp | 2 +- src/lgfx/v1/platforms/samd51/common.hpp | 2 +- src/lgfx/v1/platforms/sdl/common.hpp | 2 +- src/lgfx/v1/platforms/spresense/common.hpp | 2 +- src/lgfx/v1/platforms/stm32/common.hpp | 2 +- 13 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/lgfx/v1/platforms/arduino_default/common.hpp b/src/lgfx/v1/platforms/arduino_default/common.hpp index fdc55227..4a19f3d8 100644 --- a/src/lgfx/v1/platforms/arduino_default/common.hpp +++ b/src/lgfx/v1/platforms/arduino_default/common.hpp @@ -60,7 +60,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline void gpio_hi(uint32_t pin) { digitalWrite(pin, HIGH); } static inline void gpio_lo(uint32_t pin) { digitalWrite(pin, LOW); } diff --git a/src/lgfx/v1/platforms/esp32/common.hpp b/src/lgfx/v1/platforms/esp32/common.hpp index eb15ec54..d859e002 100644 --- a/src/lgfx/v1/platforms/esp32/common.hpp +++ b/src/lgfx/v1/platforms/esp32/common.hpp @@ -38,6 +38,11 @@ Original Source: #include #elif __has_include() #include +#elif __has_include() + #include +#else + __attribute((weak)) + bool esp_ptr_dma_capable(const void*) { return false; } #endif #if defined ( ARDUINO ) diff --git a/src/lgfx/v1/platforms/esp32s2/Bus_Parallel16.cpp b/src/lgfx/v1/platforms/esp32s2/Bus_Parallel16.cpp index 3c08ff4a..fc48a1e4 100644 --- a/src/lgfx/v1/platforms/esp32s2/Bus_Parallel16.cpp +++ b/src/lgfx/v1/platforms/esp32s2/Bus_Parallel16.cpp @@ -134,7 +134,11 @@ namespace lgfx i2s_dev->in_link.val = 0; i2s_dev->out_link.val = 0; +#if defined ( I2S_TX_PCM_BYPASS ) i2s_dev->conf1.val = I2S_TX_PCM_BYPASS | I2S_TX_STOP_EN; +#else + i2s_dev->conf1.val = (BIT(3)) | I2S_TX_STOP_EN; +#endif i2s_dev->conf2.val = I2S_LCD_EN; i2s_dev->conf_chan.val = 1 << I2S_TX_CHAN_MOD_S | 1 << I2S_RX_CHAN_MOD_S; diff --git a/src/lgfx/v1/platforms/esp32s2/Bus_Parallel8.cpp b/src/lgfx/v1/platforms/esp32s2/Bus_Parallel8.cpp index 2fdeacce..6856dc84 100644 --- a/src/lgfx/v1/platforms/esp32s2/Bus_Parallel8.cpp +++ b/src/lgfx/v1/platforms/esp32s2/Bus_Parallel8.cpp @@ -134,7 +134,11 @@ namespace lgfx i2s_dev->in_link.val = 0; i2s_dev->out_link.val = 0; +#if defined ( I2S_TX_PCM_BYPASS ) i2s_dev->conf1.val = I2S_TX_PCM_BYPASS | I2S_TX_STOP_EN; +#else + i2s_dev->conf1.val = (BIT(3)) | I2S_TX_STOP_EN; +#endif i2s_dev->conf2.val = I2S_LCD_EN; i2s_dev->conf_chan.val = 1 << I2S_TX_CHAN_MOD_S | 1 << I2S_RX_CHAN_MOD_S; diff --git a/src/lgfx/v1/platforms/esp8266/common.hpp b/src/lgfx/v1/platforms/esp8266/common.hpp index 261014c1..ec40f0cb 100644 --- a/src/lgfx/v1/platforms/esp8266/common.hpp +++ b/src/lgfx/v1/platforms/esp8266/common.hpp @@ -68,7 +68,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline void gpio_hi(int_fast8_t pin) { if (pin & 16) { if (pin == 16) *(volatile uint32_t*)(0x60000768) |= 1; } else { *(volatile uint32_t*)(0x60000304) = 1 << (pin & 15); } } static inline void gpio_lo(int_fast8_t pin) { if (pin & 16) { if (pin == 16) *(volatile uint32_t*)(0x60000768) &= ~1; } else { *(volatile uint32_t*)(0x60000308) = 1 << (pin & 15); } } diff --git a/src/lgfx/v1/platforms/framebuffer/common.hpp b/src/lgfx/v1/platforms/framebuffer/common.hpp index c2a07345..aec31850 100644 --- a/src/lgfx/v1/platforms/framebuffer/common.hpp +++ b/src/lgfx/v1/platforms/framebuffer/common.hpp @@ -45,7 +45,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } void gpio_hi(uint32_t pin); void gpio_lo(uint32_t pin); diff --git a/src/lgfx/v1/platforms/opencv/common.hpp b/src/lgfx/v1/platforms/opencv/common.hpp index e0bf9208..a931f70e 100644 --- a/src/lgfx/v1/platforms/opencv/common.hpp +++ b/src/lgfx/v1/platforms/opencv/common.hpp @@ -42,7 +42,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline void gpio_hi(uint32_t pin) { } static inline void gpio_lo(uint32_t pin) { } diff --git a/src/lgfx/v1/platforms/rp2040/common.hpp b/src/lgfx/v1/platforms/rp2040/common.hpp index 7304eb2d..40cd8fd4 100644 --- a/src/lgfx/v1/platforms/rp2040/common.hpp +++ b/src/lgfx/v1/platforms/rp2040/common.hpp @@ -100,7 +100,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } enum pin_mode_t { output diff --git a/src/lgfx/v1/platforms/samd21/common.hpp b/src/lgfx/v1/platforms/samd21/common.hpp index fdfc8100..8429554e 100644 --- a/src/lgfx/v1/platforms/samd21/common.hpp +++ b/src/lgfx/v1/platforms/samd21/common.hpp @@ -108,7 +108,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return memalign(16, length); } static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline void gpio_hi(uint32_t pin) { if (pin > 255) return; PORT->Group[pin >> samd21::PORT_SHIFT].OUTSET.reg = (1ul << (pin & samd21::PIN_MASK)); } static inline void gpio_lo(uint32_t pin) { if (pin > 255) return; PORT->Group[pin >> samd21::PORT_SHIFT].OUTCLR.reg = (1ul << (pin & samd21::PIN_MASK)); } diff --git a/src/lgfx/v1/platforms/samd51/common.hpp b/src/lgfx/v1/platforms/samd51/common.hpp index 342ff672..c74f7434 100644 --- a/src/lgfx/v1/platforms/samd51/common.hpp +++ b/src/lgfx/v1/platforms/samd51/common.hpp @@ -138,7 +138,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return memalign(16, length); } static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline void gpio_hi(uint32_t pin) { PORT->Group[pin >> samd51::PORT_SHIFT].OUTSET.reg = (1ul << (pin & samd51::PIN_MASK)); } static inline void gpio_lo(uint32_t pin) { PORT->Group[pin >> samd51::PORT_SHIFT].OUTCLR.reg = (1ul << (pin & samd51::PIN_MASK)); } diff --git a/src/lgfx/v1/platforms/sdl/common.hpp b/src/lgfx/v1/platforms/sdl/common.hpp index 89d694c4..87039d73 100644 --- a/src/lgfx/v1/platforms/sdl/common.hpp +++ b/src/lgfx/v1/platforms/sdl/common.hpp @@ -56,7 +56,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } void gpio_hi(uint32_t pin); void gpio_lo(uint32_t pin); diff --git a/src/lgfx/v1/platforms/spresense/common.hpp b/src/lgfx/v1/platforms/spresense/common.hpp index 2d532b8a..37d855cc 100644 --- a/src/lgfx/v1/platforms/spresense/common.hpp +++ b/src/lgfx/v1/platforms/spresense/common.hpp @@ -60,7 +60,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return malloc(length); } // aligned_alloc(16, length); static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline void gpio_hi(uint32_t pin) { digitalWrite(pin, HIGH); } static inline void gpio_lo(uint32_t pin) { digitalWrite(pin, LOW); } diff --git a/src/lgfx/v1/platforms/stm32/common.hpp b/src/lgfx/v1/platforms/stm32/common.hpp index 883379f0..06c36a75 100644 --- a/src/lgfx/v1/platforms/stm32/common.hpp +++ b/src/lgfx/v1/platforms/stm32/common.hpp @@ -73,7 +73,7 @@ namespace lgfx static inline void* heap_alloc_psram(size_t length) { return malloc(length); } static inline void* heap_alloc_dma( size_t length) { return memalign(16, length); } static inline void heap_free(void* buf) { free(buf); } - static inline bool heap_capable_dma(const void* ptr) { return true; } + static inline bool heap_capable_dma(const void* ptr) { return false; } static inline volatile uint32_t* get_gpio_out_reg(int_fast8_t pin) {