fix esp32 lcd show bug: Pin conflict (#339)

This commit is contained in:
ooxxU
2025-03-14 02:53:52 +08:00
committed by GitHub
parent d235ac4f52
commit e29fde6fa3
2 changed files with 11 additions and 1 deletions

View File

@ -35,12 +35,18 @@
#define BUILTIN_LED_GPIO GPIO_NUM_2
#ifdef CONFIG_LCD_ST7789_240X240_7PIN
#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_22
#define DISPLAY_CS_PIN GPIO_NUM_NC
#else
#define DISPLAY_CS_PIN GPIO_NUM_22
#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_23
#endif
#define DISPLAY_MOSI_PIN GPIO_NUM_4
#define DISPLAY_CLK_PIN GPIO_NUM_15
#define DISPLAY_DC_PIN GPIO_NUM_21
#define DISPLAY_RST_PIN GPIO_NUM_18
#define DISPLAY_CS_PIN GPIO_NUM_NC
#ifdef CONFIG_LCD_ST7789_240X320

View File

@ -12,7 +12,11 @@ namespace iot {
// 这里仅定义 Lamp 的属性和方法,不包含具体的实现
class Lamp : public Thing {
private:
#ifdef CONFIG_IDF_TARGET_ESP32
gpio_num_t gpio_num_ = GPIO_NUM_35;
#else
gpio_num_t gpio_num_ = GPIO_NUM_18;
#endif
bool power_ = false;
void InitializeGpio() {