Fixed PowerSaving for ESP32 USB companions
This commit is contained in:
1 parent
1e888cb31a
commit
d42f4240ff
2 files changed
+3
-1
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user