From 9b7b9e90943e78c0048384407ed98b26331b443b Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Mon, 15 Jun 2026 12:26:21 -0400 Subject: [PATCH] Skip X3 fingerprint probe on non-C3 boards Prevent I2C pin collision on S3/ESP32 boards by skipping the X3/X4 fingerprint probe. The probe's I2C pins (GPIO20/0) conflict with onboard peripherals like the BQ27220 gauge and reconfigure strapping pins. Force deviceType to X4 for non-C3 builds. --- lib/hal/HalGPIO.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/hal/HalGPIO.cpp b/lib/hal/HalGPIO.cpp index 1fffde56..c7cc4622 100644 --- a/lib/hal/HalGPIO.cpp +++ b/lib/hal/HalGPIO.cpp @@ -202,12 +202,22 @@ void HalGPIO::begin() { SPI.begin(EPD_SCLK, SPI_MISO, EPD_MOSI, EPD_CS); #endif +#if FREEINK_MCU_C3 _deviceType = detectDeviceTypeWithFingerprint(); if (deviceIsX4()) { pinMode(BAT_GPIO0, INPUT); pinMode(UART0_RXD, INPUT); } +#else + // Non-C3 boards (S3/ESP32) are single-device builds; their pins, panel, and + // battery backend all come from BoardConfig::ACTIVE. The X3/X4 fingerprint probe + // targets Xteink C3 hardware and drives Wire on X3_I2C_SDA/SCL (GPIO20/0) — which + // collides with this board's own I2C (e.g. Sticky's BQ27220 gauge shares GPIO0) + // and reconfigures strapping pins. Skip it; _deviceType stays X4 ("not X3"), + // the correct non-X3 branch for every deviceIsX3() consumer. + _deviceType = DeviceType::X4; +#endif } void HalGPIO::update() {