From 654897e47bde0d874089f6c7d0e1e7bb418adafa Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:10:07 +0100 Subject: [PATCH] tryfix crash --- src/main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 672276f66..931a85db3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -163,6 +163,10 @@ void setupNicheGraphics(); SPIClass SPI1(HSPI); #endif +#ifdef T5_S3_EPAPER_PRO +extern void lateInitVariant_T5S3Pro(void); +#endif + using namespace concurrency; volatile static const char slipstreamTZString[] = {USERPREFS_TZ_STRING}; @@ -400,13 +404,6 @@ void setup() pinMode(SDCARD_CS, OUTPUT); digitalWrite(SDCARD_CS, HIGH); pinMode(BOARD_BL_EN, OUTPUT); -#if !defined(T5_S3_EPAPER_PRO_V1) - io.begin(Wire, PCA9535_ADDR, SDA, SCL); - io.configPort(ExtensionIOXL9555::PORT0, 0x00); - io.configPort(ExtensionIOXL9555::PORT1, 0xFF); - io.digitalWrite(PCA9535_IO00_LORA_EN, HIGH); - delay(100); -#endif #endif concurrency::hasBeenSetup = true; #if ARCH_PORTDUINO @@ -1140,6 +1137,12 @@ void setup() #endif +#if defined(T5_S3_EPAPER_PRO) + // this must be defined here before LoRa is setup, but after the epaper display is initialised, + // as the FastEPD driver also messes around with the IO expander and uses non-arduino I2C calls + lateInitVariant_T5S3Pro(); +#endif + #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS // After modules are setup, so we can observe modules setupNicheGraphics();