Skip to content

Commit ca258af

Browse files
committed
Fix ESP32C3 compilation fail with arduino-esp32 3.2.1 / esp-idf 5.4.2
1 parent 55e708d commit ca258af

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lgfx/v1/platforms/esp32/common.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ Original Source:
156156
#endif
157157

158158

159+
160+
#if defined (CONFIG_IDF_TARGET_ESP32C6) || defined (CONFIG_IDF_TARGET_ESP32P4) || ( defined (CONFIG_IDF_TARGET_ESP32C3) && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 2) )
161+
#define LGFX_GPIO_IN_SEL_CFG_REG
162+
#endif
163+
164+
165+
159166
namespace lgfx
160167
{
161168
inline namespace v1
@@ -169,7 +176,7 @@ namespace lgfx
169176

170177
static int search_pin_number(int peripheral_sig)
171178
{
172-
#if defined (CONFIG_IDF_TARGET_ESP32C6) || defined (CONFIG_IDF_TARGET_ESP32P4)
179+
#if defined LGFX_GPIO_IN_SEL_CFG_REG
173180
uint32_t result = GPIO.func_in_sel_cfg[peripheral_sig].in_sel;
174181
#else
175182
uint32_t result = GPIO.func_in_sel_cfg[peripheral_sig].func_sel;
@@ -382,7 +389,7 @@ namespace lgfx
382389
*gpio_en_reg = 1u << (pin & 31);
383390

384391

385-
#if defined (CONFIG_IDF_TARGET_ESP32C6) || defined (CONFIG_IDF_TARGET_ESP32P4)
392+
#if defined LGFX_GPIO_IN_SEL_CFG_REG
386393
GPIO.func_out_sel_cfg[pin].out_sel = SIG_GPIO_OUT_IDX;
387394
#else
388395
GPIO.func_out_sel_cfg[pin].func_sel = SIG_GPIO_OUT_IDX;

0 commit comments

Comments
 (0)