From 0f0f91c9ffea4b24a005ce8a6c8435f60e37ba63 Mon Sep 17 00:00:00 2001 From: Kevin Le Date: Wed, 27 May 2026 09:41:29 +0700 Subject: [PATCH] Fixed directive and added isReadBusy for WiFi companion. --- examples/companion_radio/main.cpp | 2 +- src/helpers/esp32/SerialWifiInterface.cpp | 4 ++++ src/helpers/esp32/SerialWifiInterface.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index bb350fd04..a8daa0c80 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -265,7 +265,7 @@ void loop() { if (!the_mesh.hasPendingWork()) { #if defined(NRF52_PLATFORM) board.sleep(0); // nrf ignores seconds param, sleeps whenever possible -#else if defined(ESP32_PLATFORM) +#elif defined(ESP32_PLATFORM) if (!serial_interface.isReadBusy() && !serial_interface.isWriteBusy()) { // BLE is not busy vTaskDelay(pdMS_TO_TICKS(10)); // attempt to sleep } diff --git a/src/helpers/esp32/SerialWifiInterface.cpp b/src/helpers/esp32/SerialWifiInterface.cpp index 462e3ecc3..bdecb1a9d 100644 --- a/src/helpers/esp32/SerialWifiInterface.cpp +++ b/src/helpers/esp32/SerialWifiInterface.cpp @@ -39,6 +39,10 @@ size_t SerialWifiInterface::writeFrame(const uint8_t src[], size_t len) { return 0; } +bool SerialWifiInterface::isReadBusy() const { + return false; +} + bool SerialWifiInterface::isWriteBusy() const { return false; } diff --git a/src/helpers/esp32/SerialWifiInterface.h b/src/helpers/esp32/SerialWifiInterface.h index 19291497f..1ff1d83d2 100644 --- a/src/helpers/esp32/SerialWifiInterface.h +++ b/src/helpers/esp32/SerialWifiInterface.h @@ -52,6 +52,7 @@ public: bool isEnabled() const override { return _isEnabled; } bool isConnected() const override; + bool isReadBusy() const override; bool isWriteBusy() const override; size_t writeFrame(const uint8_t src[], size_t len) override;