Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
lovyan03 committed Jan 28, 2025
1 parent 829fc0e commit 256bc51
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/arduino_default/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
3 changes: 3 additions & 0 deletions src/lgfx/v1/platforms/esp32/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ Original Source:
#include <esp_memory_utils.h>
#elif __has_include(<soc/soc_memory_types.h>)
#include <soc/soc_memory_types.h>
#else
__attribute((weak))
esp_ptr_dma_capable(const void*) { return false; }
#endif

#if defined ( ARDUINO )
Expand Down
4 changes: 4 additions & 0 deletions src/lgfx/v1/platforms/esp32s2/Bus_Parallel16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions src/lgfx/v1/platforms/esp32s2/Bus_Parallel8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/esp8266/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); } }
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/framebuffer/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/opencv/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/rp2040/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/samd21/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)); }
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/samd51/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)); }
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/sdl/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/spresense/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/stm32/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 256bc51

Please sign in to comment.