From 92bfd8a5cc4e8bb01cfcf5b761204895e75b5d60 Mon Sep 17 00:00:00 2001 From: yetanothercarbot <55005345+yetanothercarbot@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:48:34 +1000 Subject: [PATCH 1/9] Initial support (bootloops) --- src/drv/tft/M5Stack.hpp | 2 +- src/drv/tft/tft_driver.h | 1 + src/drv/tft/tft_driver_lovyangfx.cpp | 40 ++++++++++++++++++++- user_setups/esp32/ttgo-t-watch.ini | 54 ++++++++++++++++++++++++++++ user_setups/esp32c3/2424S012.ini | 36 +++++++++++++++++++ 5 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 user_setups/esp32/ttgo-t-watch.ini create mode 100644 user_setups/esp32c3/2424S012.ini diff --git a/src/drv/tft/M5Stack.hpp b/src/drv/tft/M5Stack.hpp index 8822d724..0bdc9ec0 100644 --- a/src/drv/tft/M5Stack.hpp +++ b/src/drv/tft/M5Stack.hpp @@ -17,7 +17,7 @@ Contributors: /----------------------------------------------------------------------------*/ #pragma once -#if defined(ARDUINO) && defined(LGFX_USE_V1) +#if defined(ARDUINO) && defined(LGFX_USE_V1) && !defined(ESP32C3) #include "Arduino.h" #include "LovyanGFX.hpp" diff --git a/src/drv/tft/tft_driver.h b/src/drv/tft/tft_driver.h index c8bed996..b08cee35 100644 --- a/src/drv/tft/tft_driver.h +++ b/src/drv/tft/tft_driver.h @@ -32,6 +32,7 @@ enum lv_hasp_obj_type_t { TFT_PANEL_RM68140, TFT_PANEL_RGB, TFT_PANEL_EPD, + TFT_PANEL_GC9A01, TFT_PANEL_LAST, }; diff --git a/src/drv/tft/tft_driver_lovyangfx.cpp b/src/drv/tft/tft_driver_lovyangfx.cpp index 9d6d9a6a..62b5aac8 100644 --- a/src/drv/tft/tft_driver_lovyangfx.cpp +++ b/src/drv/tft/tft_driver_lovyangfx.cpp @@ -94,8 +94,12 @@ static lgfx::Bus_Parallel8* init_parallel_8_bus(Preferences* prefs, int8_t data_ cfg.pin_rd = prefs->getInt("rd", TFT_RD); cfg.pin_wr = prefs->getInt("wr", TFT_WR); cfg.pin_rs = prefs->getInt("rs", TFT_DC); +#ifndef ESP32C3 cfg.freq_write = prefs->getUInt("write_freq", SPI_FREQUENCY); -#if !defined(CONFIG_IDF_TARGET_ESP32S3) +#endif + + +#if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(ESP32C3) uint8_t port = prefs->getUInt("i2s_port", 0); switch(port) { #if SOC_I2S_NUM > 1 @@ -328,6 +332,11 @@ lgfx::Panel_Device* LovyanGfx::_init_panel(lgfx::IBus* bus) LOG_VERBOSE(TAG_TFT, F("Panel_RGB")); break; } + case TFT_PANEL_GC9A01: { + panel = new lgfx::Panel_GC9A01(); + LOG_VERBOSE(TAG_TFT, F("Panel_GC9A01")); + break; + } default: { // Needs to be in curly braces LOG_FATAL(TAG_TFT, F(D_SERVICE_START_FAILED ": %s line %d"), __FILE__, __LINE__); } @@ -455,6 +464,31 @@ lgfx::ITouch* _init_touch(Preferences* preferences) } #endif +#if TOUCH_DRIVER == 0x816 + { + auto touch = new lgfx::Touch_CST816S(); + auto cfg = touch->config(); + + cfg.x_min = 0; + cfg.x_max = TFT_WIDTH - 1; + cfg.y_min = 0; + cfg.y_max = TFT_HEIGHT - 1; + cfg.pin_int = TOUCH_IRQ; + cfg.bus_shared = true; + cfg.offset_rotation = TOUCH_OFFSET_ROTATION; + + // I2C接続の場合 + cfg.i2c_port = I2C_TOUCH_PORT; + cfg.i2c_addr = I2C_TOUCH_ADDRESS; + cfg.pin_sda = TOUCH_SDA; + cfg.pin_scl = TOUCH_SCL; + cfg.freq = I2C_TOUCH_FREQUENCY; + + touch->config(cfg); + return touch; + } +#endif + #endif // HASP_USE_LGFX_TOUCH return nullptr; @@ -1261,6 +1295,8 @@ const char* LovyanGfx::get_tft_model() return "R61529"; #elif defined(RM68140_DRIVER) return "RM68140"; +#elif defined(GC9A01_DRIVER) + return "GC9A01"; #else return "Other"; #endif @@ -1302,6 +1338,8 @@ uint32_t LovyanGfx::get_tft_driver() return TFT_PANEL_EPD; #elif defined(RGB_DRIVER) return TFT_PANEL_RGB; +#elif defined(GC9A01_DRIVER) + return TFT_PANEL_GC9A01; #else return TFT_PANEL_UNKNOWN; #endif diff --git a/user_setups/esp32/ttgo-t-watch.ini b/user_setups/esp32/ttgo-t-watch.ini new file mode 100644 index 00000000..91b114ba --- /dev/null +++ b/user_setups/esp32/ttgo-t-watch.ini @@ -0,0 +1,54 @@ +[ttgo-t-watch] + +extends = arduino_esp32_v2 +board = esp32dev + +build_flags = + ${arduino_esp32_v2.build_flags} + ${esp32.ps_ram} + +;region -- TFT_eSPI build options ------------------------ + -D LGFX_USE_V1=1 + -D HASP_USE_LGFX_TOUCH=1 + -D ST7789_DRIVER=1 + -D TFT_HEIGHT=240 + -D TFT_WIDTH=240 + -D TFT_DC=27 + -D TFT_CS=5 + -D TFT_MOSI=19 + -D TFT_RST=-1 + -D TFT_SCLK=18 + -D TFT_BCKL=12 + -D SPI_FREQUENCY=40000000 + -D I2C_TOUCH_ADDRESS=0x38 + -D I2C_TOUCH_FREQUENCY=400000 + -D TOUCH_DRIVER=0x6336 + -D I2C_TOUCH_PORT=1 + -D TOUCH_IRQ=38 + -D TOUCH_RST=-1 + -D TOUCH_SDA=23 + -D TOUCH_SCL=32 +;endregion + +lib_deps = + ${arduino_esp32_v2.lib_deps} + ${lovyangfx.lib_deps} + ${ft6336.lib_deps} + +[env:ttgo-t-watch-2019] +extends = ttgo-t-watch, flash_16mb + +build_flags = + ${ttgo-t-watch.build_flags} + -D HASP_MODEL="TTgo T-Watch 2019" + -D INVERT_COLORS=1 + +[env:ttgo-t-watch-2020] +extends = ttgo-t-watch, flash_16mb + +build_flags = + ${ttgo-t-watch.build_flags} + -D HASP_MODEL="TTgo T-Watch 2020" + -D TFT_ROTATION=0 + ;-D TFT_ROTATION=2 + -D TOUCH_OFFSET_ROTATION=4 ; 1=swap xy, 2=invert x, 4=inverty \ No newline at end of file diff --git a/user_setups/esp32c3/2424S012.ini b/user_setups/esp32c3/2424S012.ini new file mode 100644 index 00000000..d05ac04c --- /dev/null +++ b/user_setups/esp32c3/2424S012.ini @@ -0,0 +1,36 @@ +[env:2424S012] +extends = arduino_esp32c3_v2, flash_4mb +; Close enough +board = seeed_xiao_esp32c3 + +build_flags = + -D HASP_MODEL="ESP32-2424S012" + ${arduino_esp32c3_v2.build_flags} + ${esp32c3.no_ps_ram} + +; Display configuration + -D ESP32C3=1 + -D LGFX_USE_V1=1 + -D HASP_USE_LGFX_TOUCH=1 + ;CST816S driver + -D TOUCH_DRIVER=0x816 + -D GC9A01_DRIVER=1 + -D TFT_WIDTH=240 + -D TFT_HEIGHT=240 + -D TOUCH_SDA=4 + -D TOUCH_SCL=5 + -D TOUCH_IRQ=0 + -D TOUCH_RST=1 + -D I2C_TOUCH_FREQUENCY=400000 + -D I2C_TOUCH_PORT=0 + -D I2C_TOUCH_ADDRESS=0x15 + -D TFT_SCLK=6 + -D TFT_MOSI=7 + -D TFT_DC=2 + -D TFT_CS=10 + -D TFT_BCKL=3 + +lib_deps = + ${arduino_esp32s3_v2.lib_deps} + ${lovyangfx.lib_deps} +; ${tft_espi.lib_deps} \ No newline at end of file From 462491a5b28e1c5e7e8a827d414effdc4916bab8 Mon Sep 17 00:00:00 2001 From: yetanothercarbot <55005345+yetanothercarbot@users.noreply.github.com> Date: Fri, 26 Apr 2024 00:11:54 +1000 Subject: [PATCH 2/9] Use SDK-provided define instead of own --- src/drv/tft/M5Stack.hpp | 2 +- src/drv/tft/tft_driver_lovyangfx.cpp | 4 ++-- user_setups/esp32c3/2424S012.ini | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/drv/tft/M5Stack.hpp b/src/drv/tft/M5Stack.hpp index 0bdc9ec0..83a8ccd9 100644 --- a/src/drv/tft/M5Stack.hpp +++ b/src/drv/tft/M5Stack.hpp @@ -17,7 +17,7 @@ Contributors: /----------------------------------------------------------------------------*/ #pragma once -#if defined(ARDUINO) && defined(LGFX_USE_V1) && !defined(ESP32C3) +#if defined(ARDUINO) && defined(LGFX_USE_V1) && !defined(CONFIG_IDF_TARGET_ESP32C3) #include "Arduino.h" #include "LovyanGFX.hpp" diff --git a/src/drv/tft/tft_driver_lovyangfx.cpp b/src/drv/tft/tft_driver_lovyangfx.cpp index 62b5aac8..bc3854f9 100644 --- a/src/drv/tft/tft_driver_lovyangfx.cpp +++ b/src/drv/tft/tft_driver_lovyangfx.cpp @@ -94,12 +94,12 @@ static lgfx::Bus_Parallel8* init_parallel_8_bus(Preferences* prefs, int8_t data_ cfg.pin_rd = prefs->getInt("rd", TFT_RD); cfg.pin_wr = prefs->getInt("wr", TFT_WR); cfg.pin_rs = prefs->getInt("rs", TFT_DC); -#ifndef ESP32C3 +#ifndef CONFIG_IDF_TARGET_ESP32C3 cfg.freq_write = prefs->getUInt("write_freq", SPI_FREQUENCY); #endif -#if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(ESP32C3) +#if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C3) uint8_t port = prefs->getUInt("i2s_port", 0); switch(port) { #if SOC_I2S_NUM > 1 diff --git a/user_setups/esp32c3/2424S012.ini b/user_setups/esp32c3/2424S012.ini index d05ac04c..c3179422 100644 --- a/user_setups/esp32c3/2424S012.ini +++ b/user_setups/esp32c3/2424S012.ini @@ -1,6 +1,6 @@ [env:2424S012] extends = arduino_esp32c3_v2, flash_4mb -; Close enough +; Close enough, sets it up to use USB-CDC rather than uart board = seeed_xiao_esp32c3 build_flags = @@ -9,7 +9,6 @@ build_flags = ${esp32c3.no_ps_ram} ; Display configuration - -D ESP32C3=1 -D LGFX_USE_V1=1 -D HASP_USE_LGFX_TOUCH=1 ;CST816S driver @@ -32,5 +31,4 @@ build_flags = lib_deps = ${arduino_esp32s3_v2.lib_deps} - ${lovyangfx.lib_deps} -; ${tft_espi.lib_deps} \ No newline at end of file + ${lovyangfx.lib_deps} \ No newline at end of file From 78ac4d95b4a3fc8de642351db2c43b6b1ea17ab8 Mon Sep 17 00:00:00 2001 From: yetanothercarbot <55005345+yetanothercarbot@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:02:23 +1000 Subject: [PATCH 3/9] Boot without serial connected --- user_setups/esp32c3/2424S012.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/user_setups/esp32c3/2424S012.ini b/user_setups/esp32c3/2424S012.ini index c3179422..7259a624 100644 --- a/user_setups/esp32c3/2424S012.ini +++ b/user_setups/esp32c3/2424S012.ini @@ -28,6 +28,7 @@ build_flags = -D TFT_DC=2 -D TFT_CS=10 -D TFT_BCKL=3 + -D SERIAL_SPEED=-1 ;otherwise requires serial term to boot first time lib_deps = ${arduino_esp32s3_v2.lib_deps} From 180cc84ea2abbb9686775b277d6d57be5929436e Mon Sep 17 00:00:00 2001 From: FreeBear Date: Fri, 17 May 2024 00:09:34 +0100 Subject: [PATCH 4/9] Minor spelling mistake corrected --- src/hasp_filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hasp_filesystem.cpp b/src/hasp_filesystem.cpp index ac39a344..1f9f4953 100644 --- a/src/hasp_filesystem.cpp +++ b/src/hasp_filesystem.cpp @@ -180,7 +180,7 @@ void filesystemList() #else if(!HASP_FS.begin(true)) { // default vfs path: /littlefs #endif - LOG_ERROR(TAG_FILE, F("Flash file system not mouted.")); + LOG_ERROR(TAG_FILE, F("Flash file system not mounted.")); } else { LOG_VERBOSE(TAG_FILE, F("Listing files on the internal flash:")); From 182c8c670b640502f5efbfe973ed4affbd41d65c Mon Sep 17 00:00:00 2001 From: K Date: Sat, 18 May 2024 19:32:04 -0400 Subject: [PATCH 5/9] Add support for Guition JC4827W543 --- platformio.ini | 2 +- src/drv/tft/tft_driver_arduinogfx.cpp | 8 +++ src/hasp_gui.cpp | 2 +- user_setups/esp32s3/guition-jc4827w543.ini | 60 ++++++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 user_setups/esp32s3/guition-jc4827w543.ini diff --git a/platformio.ini b/platformio.ini index 444439fc..a003dc93 100644 --- a/platformio.ini +++ b/platformio.ini @@ -112,7 +112,7 @@ lib_deps = [arduinogfx] lib_deps = - moononournation/GFX Library for Arduino@1.4.0 ; Update needs modification of custom PCA class + moononournation/GFX Library for Arduino@1.4.7 ; Update needs modification of custom PCA class ;git+https://github.com/moononournation/Arduino_GFX.git [tft_espi] diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index c946120a..601d841f 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -85,6 +85,10 @@ void ArduinoGfx::init(int w, int h) /* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */ tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST, st7701_type1_init_operations, sizeof(st7701_type1_init_operations)); +#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 272) && defined(NV3041A_DRIVER) + Arduino_DataBus* bus = new Arduino_ESP32QSPI(TFT_CS, TFT_SCK, TFT_D0, TFT_D1, TFT_D2, TFT_D3); + Arduino_GFX* g = new Arduino_NV3041A(bus, TFT_RST, TFT_ROTATION, TFT_IPS); + tft = g; #elif 1 /* Reset is not implemented in the panel */ if(TFT_RST != GFX_NOT_DEFINED) { @@ -299,6 +303,8 @@ const char* ArduinoGfx::get_tft_model() return "R61529"; #elif defined(RM68140_DRIVER) return "RM68140"; +#elif defined(NV3041A_DRIVER) + return "NV3041A"; #else return "Other"; #endif @@ -336,6 +342,8 @@ uint32_t ArduinoGfx::get_tft_driver() return 0x61529; #elif defined(RM68140_DRIVER) return 0x68140; +#elif defined(NV3041A_DRIVER) + return 0x3041A; #else return 0x0; #endif diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 13caf317..ebb7870a 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -341,7 +341,7 @@ void guiSetup() #endif gui_hide_pointer(false); if(mouse_indev != NULL) { - lv_indev_set_cursor(mouse_indev, cursor); /*Connect the image object to the driver*/ + lv_indev_set_cursor(mouse_indev, cursor); /*Connect the image object to the driver*/ } #if HASP_TARGET_ARDUINO diff --git a/user_setups/esp32s3/guition-jc4827w543.ini b/user_setups/esp32s3/guition-jc4827w543.ini new file mode 100644 index 00000000..ae5f15e7 --- /dev/null +++ b/user_setups/esp32s3/guition-jc4827w543.ini @@ -0,0 +1,60 @@ +;***************************************************; +; Guition ESP32-S3 TFT 4.3" ; +; - Custom esp32-s3 board ; +; - nv3041a 480x272 ; +; - gt911 touch controller ; +;***************************************************; + +[guition-esp32-s3-tft] +extends = arduino_esp32s3_v2 +board = esp32-s3-devkitc-1 +board_build.arduino.memory_type = qio_opi + +build_flags = + ${arduino_esp32s3_v2.build_flags} + ${esp32s3.ps_ram} + ;-D HASP_MODEL="Guition 4.3\"" + +;region -- ArduinoGFX build options ------------------------ + -D HASP_USE_ARDUINOGFX + -D NV3041A_DRIVER + -D BACKLIGHT_FREQUENCY=50 + ;endregion + +lib_deps = + ${arduino_esp32s3_v2.lib_deps} + ${arduinogfx.lib_deps} + ${goodix.lib_deps} + + +[guition-tft-common-pins] +build_flags = + -D TFT_BCKL=1 + -D TFT_CS=45 + -D TFT_SCK=47 + -D TFT_D0=21 + -D TFT_D1=48 + -D TFT_D2=40 + -D TFT_D3=39 + -D TFT_RST=GFX_NOT_DEFINED + -D TFT_ROTATION=0 + -D TFT_IPS=true + -D TFT_WIDTH=480 + -D TFT_HEIGHT=272 + +[guition-jc4827w543] +extends = guition-esp32-s3-tft +debug_tool = esp-builtin +debug_build_flags = -Os # optimize for size +build_flags = + -D HASP_MODEL="Guition ESP32-S3 JC4827W543" + ${guition-esp32-s3-tft.build_flags} + ${guition-tft-common-pins.build_flags} + ; Touch Settings + -D TOUCH_DRIVER=0x0911 + -D TOUCH_SCL=4 + -D TOUCH_SDA=8 + -D TOUCH_IRQ=-1 + -D TOUCH_RST=38 + -D I2C_TOUCH_FREQUENCY=0 + -D I2C_TOUCH_ADDRESS=0x5D \ No newline at end of file From c70dfe6d424ef0c5b433a4446304f2cd0db7f278 Mon Sep 17 00:00:00 2001 From: FreeBear Date: Mon, 20 May 2024 15:03:19 +0100 Subject: [PATCH 6/9] Add list of TFT gpio pins so that they can not be selected for IO. --- src/drv/tft/tft_driver_arduinogfx.cpp | 98 +++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index c946120a..e050059c 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -262,6 +262,104 @@ void IRAM_ATTR ArduinoGfx::flush_pixels(lv_disp_drv_t* disp, const lv_area_t* ar bool ArduinoGfx::is_driver_pin(uint8_t pin) { + if(false // start condition is always needed + +// Use individual checks instead of switch statement, as some case labels could be duplicated +#ifdef TFT_MOSI + || (pin == TFT_MOSI) +#endif +#ifdef TFT_MISO + || (pin == TFT_MISO) +#endif +#ifdef TFT_SCLK + || (pin == TFT_SCLK) +#endif +#ifdef TFT_CS + || (pin == TFT_CS) +#endif +#ifdef TFT_DC + || (pin == TFT_DC) +#endif +#ifdef TFT_DE + || (pin == TFT_DE) +#endif +#ifdef TFT_PCLK + || (pin == TFT_PCLK) +#endif +#ifdef TFT_VSYNC + || (pin == TFT_VSYNC) +#endif +#ifdef TFT_HSYNC + || (pin == TFT_HSYNC) +#endif +#ifdef TFT_BCKL + || (pin == TFT_BCKL) +#endif +#ifdef TFT_RST + || (pin == TFT_RST) +#endif +#ifdef TFT_BUSY + || (pin == TFT_BUSY) +#endif +#ifdef TFT_RD + || (pin == TFT_RD) +#endif +#ifdef TFT_R0 + || (pin == TFT_R0) +#endif +#ifdef TFT_R1 + || (pin == TFT_R1) +#endif +#ifdef TFT_R2 + || (pin == TFT_R2) +#endif +#ifdef TFT_R3 + || (pin == TFT_R3) +#endif +#ifdef TFT_R4 + || (pin == TFT_R4) +#endif +#ifdef TFT_G0 + || (pin == TFT_G0) +#endif +#ifdef TFT_G1 + || (pin == TFT_G1) +#endif +#ifdef TFT_G2 + || (pin == TFT_G2) +#endif +#ifdef TFT_G3 + || (pin == TFT_G3) +#endif +#ifdef TFT_G4 + || (pin == TFT_G4) +#endif +#ifdef TFT_B0 + || (pin == TFT_B0) +#endif +#ifdef TFT_B1 + || (pin == TFT_B1) +#endif +#ifdef TFT_B2 + || (pin == TFT_B2) +#endif +#ifdef TFT_B3 + || (pin == TFT_B3) +#endif +#ifdef TFT_B4 + || (pin == TFT_B4) +#endif + ) { + return true; + } + +#ifdef ARDUINO_ARCH_ESP8266 +#ifndef TFT_SPI_OVERLAP + if((pin >= 12) && (pin <= 14)) return true; // HSPI +#endif +#endif + + return false; return false; } From 7a3b8d0997fe8367ad27f755f4f07df0a4ea77b4 Mon Sep 17 00:00:00 2001 From: FreeBear Date: Mon, 20 May 2024 15:30:15 +0100 Subject: [PATCH 7/9] Add the touch gpio pins to the list so that they are hidden from IO selection. --- src/drv/tft/tft_driver_arduinogfx.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index e050059c..00847ca3 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -348,6 +348,18 @@ bool ArduinoGfx::is_driver_pin(uint8_t pin) #endif #ifdef TFT_B4 || (pin == TFT_B4) +#endif +#ifdef TOUCH_SDA + || (pin == TOUCH_SDA) +#endif +#ifdef TOUCH_SCL + || (pin == TOUCH_SCL) +#endif +#ifdef TOUCH_RST + || (pin == TOUCH_RST) +#endif +#ifdef TOUCH_IRQ + || (pin == TOUCH_IRQ) #endif ) { return true; From 86d45119404b9c7cbca170b911a56c07690dca5c Mon Sep 17 00:00:00 2001 From: K Date: Mon, 20 May 2024 12:18:33 -0400 Subject: [PATCH 8/9] Fix backlight freq and suffix build target --- user_setups/esp32s3/guition-jc4827w543.ini | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/user_setups/esp32s3/guition-jc4827w543.ini b/user_setups/esp32s3/guition-jc4827w543.ini index ae5f15e7..689b764c 100644 --- a/user_setups/esp32s3/guition-jc4827w543.ini +++ b/user_setups/esp32s3/guition-jc4827w543.ini @@ -18,7 +18,6 @@ build_flags = ;region -- ArduinoGFX build options ------------------------ -D HASP_USE_ARDUINOGFX -D NV3041A_DRIVER - -D BACKLIGHT_FREQUENCY=50 ;endregion lib_deps = @@ -42,12 +41,12 @@ build_flags = -D TFT_WIDTH=480 -D TFT_HEIGHT=272 -[guition-jc4827w543] -extends = guition-esp32-s3-tft +[guition-jc4827w543c] +extends = guition-esp32-s3-tft, flash_4mb debug_tool = esp-builtin debug_build_flags = -Os # optimize for size build_flags = - -D HASP_MODEL="Guition ESP32-S3 JC4827W543" + -D HASP_MODEL="Guition ESP32-S3 JC4827W543C" ${guition-esp32-s3-tft.build_flags} ${guition-tft-common-pins.build_flags} ; Touch Settings @@ -57,4 +56,4 @@ build_flags = -D TOUCH_IRQ=-1 -D TOUCH_RST=38 -D I2C_TOUCH_FREQUENCY=0 - -D I2C_TOUCH_ADDRESS=0x5D \ No newline at end of file + -D I2C_TOUCH_ADDRESS=0x5D From ca6d521a0a5d22f4bbb1c6c4b6146dad03fa5584 Mon Sep 17 00:00:00 2001 From: FreeBear Date: Tue, 21 May 2024 13:14:58 +0100 Subject: [PATCH 9/9] Missing the FILE_SIZE_DIVIDER for gigabits - This results in the number being printed with the decimal point in the wrong place. --- src/hasp/hasp_parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hasp/hasp_parser.cpp b/src/hasp/hasp_parser.cpp index a44a9741..eee1175d 100644 --- a/src/hasp/hasp_parser.cpp +++ b/src/hasp/hasp_parser.cpp @@ -212,6 +212,7 @@ int Parser::format_bytes(size_t filesize, char* buf, size_t len) return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%02d " D_FILE_SIZE_MEGABYTES), filesize / 100, filesize % 100); + filesize = filesize / D_FILE_SIZE_DIVIDER; // multiply by 100 for 2 decimal place return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%02d " D_FILE_SIZE_GIGABYTES), filesize / 100, filesize % 100); }