Fixed PowerSaving for ESP32 USB companions

This commit is contained in:
Kevin Le committed 2026-08-14 23:42:25 +07:00
1 parent 1e888cb31a
commit d42f4240ff
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -296,9 +296,11 @@ void loop() {
#if defined(NRF52_PLATFORM)
board.sleep(0); // nrf ignores seconds param, sleeps whenever possible
#elif defined(ESP32_PLATFORM)
#if defined(BLE_PIN_CODE)
if (!bluetooth_interface.isReadBusy() && !bluetooth_interface.isWriteBusy()) { // BLE is not busy
vTaskDelay(pdMS_TO_TICKS(10)); // attempt to sleep
}
#endif
#endif
}
+1 -1
View File
@@ -189,7 +189,7 @@ size_t SerialBLEInterface::writeFrame(const uint8_t src[], size_t len) {
#define BLE_WRITE_MIN_INTERVAL 60
bool SerialBLEInterface::isReadBusy() const {
return uxQueueMessagesWaiting(recv_queue) > 0; // Kevin
return uxQueueMessagesWaiting(recv_queue) > 0;
}
bool SerialBLEInterface::isWriteBusy() const {