Delayed sleep for BLE companions if BLE read is busy. Reduced sleep period from 50 sticks to 10 sticks
This commit is contained in:
1 parent
e608503aa0
commit
7f02cbe80b
4 files changed
+8
-2
No files matched your search
@@ -266,8 +266,8 @@ void loop() {
|
||||
#if defined(NRF52_PLATFORM)
|
||||
board.sleep(0); // nrf ignores seconds param, sleeps whenever possible
|
||||
#else if defined(ESP32_PLATFORM)
|
||||
if (!serial_interface.isWriteBusy()) { // BLE is not busy
|
||||
vTaskDelay(pdMS_TO_TICKS(50)); // attempt to sleep
|
||||
if (!serial_interface.isReadBusy() && !serial_interface.isWriteBusy()) { // BLE is not busy
|
||||
vTaskDelay(pdMS_TO_TICKS(10)); // attempt to sleep
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user