From 42d812dedd1bf1c9ff52762eeabceb0993ca6b12 Mon Sep 17 00:00:00 2001 From: Christos Themelis Date: Wed, 18 Mar 2026 00:32:20 +0200 Subject: [PATCH] Update SenseCapHAL.h --- src/helpers/esp32/SenseCapHAL.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/helpers/esp32/SenseCapHAL.h b/src/helpers/esp32/SenseCapHAL.h index f55fe1d5d..a7ed4cfbd 100644 --- a/src/helpers/esp32/SenseCapHAL.h +++ b/src/helpers/esp32/SenseCapHAL.h @@ -94,13 +94,20 @@ public: // ── Overrides ────────────────────────────────────────────────────────── - // Initialize SPI with the correct pin numbers for SenseCAP Indicator + // Initialize SPI with the correct pin numbers for SenseCAP Indicator. void spiBegin() override { this->spi->begin(_sclk, _miso, _mosi); Serial.printf("[SenseCapHAL] SPI begin: SCLK=%d MISO=%d MOSI=%d\n", _sclk, _miso, _mosi); } + // ArduinoHal::init() only calls spiBegin() when initInterface==true, + // which is NOT set when an explicit SPIClass& is passed to the constructor. + // Override init() to always initialise SPI with our custom pins. + void init() override { + spiBegin(); + } + void pinMode(uint32_t pin, uint32_t mode) override { if (isExp(pin) && isPort0(pin)) { if (mode == OUTPUT) _cfg0 &= ~expBit(pin);