From 9d2f31b0e2a2dd9ab06c01fb91adfd56736b9f92 Mon Sep 17 00:00:00 2001 From: busbuyukefe Date: Sun, 24 Sep 2023 22:06:24 +0300 Subject: [PATCH] Fix backlight related pins, wrong resolution and typo error --- include/esp32_smartdisplay.h | 8 ++++---- src/esp32_smartdisplay.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/esp32_smartdisplay.h b/include/esp32_smartdisplay.h index 4bec8f6..4230172 100644 --- a/include/esp32_smartdisplay.h +++ b/include/esp32_smartdisplay.h @@ -91,8 +91,8 @@ extern SPIClass spi_xpt2046; // ESP32_2432S024C #ifdef ESP32_2432S024C -#define TFT_WIDTH 320 -#define TFT_HEIGHT 480 +#define TFT_WIDTH 240 +#define TFT_HEIGHT 320 #define ILI9431 #define ILI9431_SPI_SCLK 14 #define ILI9431_SPI_MOSI 13 @@ -100,8 +100,8 @@ extern SPIClass spi_xpt2046; #define ILI9341_PIN_CS 15 #define ILI9341_PIN_DC 2 #define ILI9341_SPI_FREQ 50000000 -#define ILI9341_PIN_BL 21 -#define ILI9341_PWM_CHANNEL_BL 12 +#define ILI9341_PIN_BL 27 +#define ILI9341_PWM_CHANNEL_BL 7 #define ILI9341_PWM_FREQ_BL 5000 #define ILI9341_PWM_BITS_BL 8 #define ILI9341_PWM_MAX_BL ((1 << ILI9341_PWM_BITS_BL) - 1) diff --git a/src/esp32_smartdisplay.cpp b/src/esp32_smartdisplay.cpp index acb50a0..4bd5f1f 100644 --- a/src/esp32_smartdisplay.cpp +++ b/src/esp32_smartdisplay.cpp @@ -103,7 +103,7 @@ void smartdisplay_init() spi_xpt2046.begin(XPT2046_SPI_SCLK, XPT2046_SPI_MISO, XPT2046_SPI_MOSI); #endif -#ifdef ESP32_3248S024C +#ifdef ESP32_2432S024C spi_ili9431.begin(ILI9431_SPI_SCLK, ILI9431_SPI_MISO, ILI9431_SPI_MOSI); i2c_cst820.begin(CST820_IIC_SDA, CST820_IIC_SCL); #endif