diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 951f60ea..854aec62 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -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 } diff --git a/src/helpers/esp32/SerialBLEInterface.cpp b/src/helpers/esp32/SerialBLEInterface.cpp index 1a8e3593..2e1343f5 100644 --- a/src/helpers/esp32/SerialBLEInterface.cpp +++ b/src/helpers/esp32/SerialBLEInterface.cpp @@ -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 {