From 3fde170dca16863218cec133e05c5f2fc8d6e59a Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 14 Apr 2025 16:45:33 +0200 Subject: [PATCH] WT32-SC01 support --- include/graphics/LGFX/LGFX_WT_SC01PLUS.h | 2 +- source/comms/serial/UARTClient.cpp | 2 +- source/graphics/common/SdCard.cpp | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/graphics/LGFX/LGFX_WT_SC01PLUS.h b/include/graphics/LGFX/LGFX_WT_SC01PLUS.h index afb5b0d..2979feb 100644 --- a/include/graphics/LGFX/LGFX_WT_SC01PLUS.h +++ b/include/graphics/LGFX/LGFX_WT_SC01PLUS.h @@ -102,7 +102,7 @@ class LGFX_WT_SC01_PLUS : public lgfx::LGFX_Device cfg.bus_shared = true; cfg.offset_rotation = 0; // I2C - cfg.i2c_port = 1; + cfg.i2c_port = 0; cfg.i2c_addr = 0x38; cfg.pin_sda = 6; cfg.pin_scl = 5; diff --git a/source/comms/serial/UARTClient.cpp b/source/comms/serial/UARTClient.cpp index 30ecc97..ecd3bfc 100644 --- a/source/comms/serial/UARTClient.cpp +++ b/source/comms/serial/UARTClient.cpp @@ -13,7 +13,7 @@ extern const uint8_t MT_MAGIC_0; -UARTClient::UARTClient(void) : _serial(nullptr) {} +UARTClient::UARTClient(void) : _serial(nullptr), lastReceived(0) {} /** * @brief init serial interface diff --git a/source/graphics/common/SdCard.cpp b/source/graphics/common/SdCard.cpp index d76eed3..aec727c 100644 --- a/source/graphics/common/SdCard.cpp +++ b/source/graphics/common/SdCard.cpp @@ -10,7 +10,12 @@ fs::SDMMCFS &SDFs = SD_MMC; #elif defined(ARCH_PORTDUINO) fs::FS &SDFs = PortduinoFS; #elif defined(HAS_SDCARD) -SPIClass &SDHandler = SPI; +#ifdef SDCARD_USE_SPI1 +static SPIClass SPI1(HSPI); +static SPIClass &SDHandler = SPI1; +#else +static SPIClass &SDHandler = SPI; +#endif SdFs SDFs; using File = FsFile; #endif