Skip to content

Commit 5011f88

Browse files
committed
Rename new esp_yield(...) with blocking predicate argument to more descriptive esp_suspend(...).
Provide esp_suspend(void) as wrapper for esp_yield().
1 parent ea5648b commit 5011f88

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

cores/esp8266/coredecls.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ void settimeofday_cb (const TrivialCB& cb);
3939

4040
using IsBlockedCB = Delegate<bool(), void*>;
4141

42-
inline void esp_yield(const IsBlockedCB& blocked) {
42+
inline void esp_suspend() {
43+
esp_yield();
44+
}
45+
46+
inline void esp_suspend(const IsBlockedCB& blocked) {
4347
do {
44-
esp_yield();
48+
esp_suspend();
4549
} while (blocked());
4650
}
4751

libraries/ESP8266WiFi/src/ESP8266WiFiSTA-WPS.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bool ESP8266WiFiSTAClass::beginWPSConfig(void) {
7474

7575
_wps_config_pending = true;
7676
// will resume when wifi_wps_status_cb fires
77-
esp_yield([]() { return _wps_config_pending; });
77+
esp_suspend([]() { return _wps_config_pending; });
7878

7979
return true;
8080
}

libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int8_t ESP8266WiFiScanClass::scanNetworks(bool async, bool show_hidden, uint8 ch
9797
}
9898

9999
// will resume when _scanDone fires
100-
esp_yield([]() { return !ESP8266WiFiScanClass::_scanComplete && ESP8266WiFiScanClass::_scanStarted; });
100+
esp_suspend([]() { return !ESP8266WiFiScanClass::_scanComplete && ESP8266WiFiScanClass::_scanStarted; });
101101

102102
return ESP8266WiFiScanClass::_scanCount;
103103
} else {

tests/host/common/Arduino.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ extern "C" void esp_delay (unsigned long ms)
6565

6666
using IsBlockedCB = Delegate<bool(), void*>;
6767

68-
inline void esp_yield(const IsBlockedCB& blocked) {
68+
inline void esp_suspend() {
69+
esp_yield();
70+
}
71+
72+
inline void esp_suspend(const IsBlockedCB& blocked) {
6973
(void)blocked;
7074
}
7175

0 commit comments

Comments
 (0)