diff --git a/Power.h b/Power.h index 48029f7..a68ed43 100644 --- a/Power.h +++ b/Power.h @@ -683,10 +683,12 @@ bool init_pmu() { return true; #elif BOARD_MODEL == BOARD_TWATCH_ULT - Wire.begin(I2C_SDA, I2C_SCL); - + // Pass explicit SDA/SCL pins to XPowersLib constructor. + // The generic esp32s3 FQBN defaults to SDA=8, SCL=9 which are WRONG + // for the T-Watch Ultra (SDA=3, SCL=2). XPowersLib's begin() calls + // Wire.begin(__sda, __scl) internally, so we must set the correct pins here. if (!PMU) { - PMU = new XPowersAXP2101(PMU_WIRE_PORT); + PMU = new XPowersAXP2101(PMU_WIRE_PORT, I2C_SDA, I2C_SCL); if (!PMU->init()) { delete PMU; PMU = NULL; diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index fee2e33..f3d0616 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -20,13 +20,6 @@ #if BOARD_MODEL == BOARD_TWATCH_ULT #include "XL9555.h" #include "CO5300.h" - - // I2C diagnostic storage - uint8_t i2c_scan_results[16]; - uint8_t i2c_scan_count = 0; - bool i2c_wire_ok = false; - uint8_t i2c_sda_level = 0xFF; // SDA pin level before Wire.begin - uint8_t i2c_scl_level = 0xFF; // SCL pin level before Wire.begin #endif #define CHANNEL_FIFO_SIZE (CONFIG_UART_BUFFER_SIZE / NUM_CHANNELS) @@ -279,22 +272,6 @@ void setup() { #endif #if BOARD_MODEL == BOARD_TWATCH_ULT - // I2C scan AFTER PMU init (which calls Wire.begin) - i2c_scan_count = 0; // reuse as AXP2101 probe result - if (pmu_ready) { - // PMU worked — scan for all devices - for (uint8_t addr = 0x08; addr < 0x78; addr++) { - Wire.beginTransmission(addr); - if (Wire.endTransmission() == 0 && i2c_scan_count < 16) { - i2c_scan_results[i2c_scan_count++] = addr; - } - } - } else { - // PMU failed — probe AXP2101 directly for diagnostics - Wire.beginTransmission(0x34); - i2c_scan_count = Wire.endTransmission(); // store error code - } - xl9555_init(); xl9555_enable_lora_antenna(); #endif