Fix race condition in esp now communication (#1673)

when calling mac address to fast after setting it

happened on ESP32-WROOM-32E with IDF version > 5

Co-authored-by: dosas <dosas@github.com>
This commit is contained in:
dosas 2024-08-22 21:14:46 +02:00 committed by GitHub
parent 22cc9232c8
commit 284d525693
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,6 +112,7 @@ class ESPNowStream : public BaseStream {
LOGE("Could not set mac address");
return false;
}
delay(500); // On some boards calling macAddress to early leads to a race condition.
// checking if address has been updated
const char *addr = macAddress();
if (strcmp(addr, cfg.mac_address) != 0) {