Skip to content

Commit 79beda7

Browse files
committed
Any delay(0) is expected to yield.
1 parent b9da2e0 commit 79beda7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/esp8266/core_esp8266_main.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ extern "C" void __esp_delay(unsigned long ms) {
163163
extern "C" void esp_delay(unsigned long ms) __attribute__((weak, alias("__esp_delay")));
164164

165165
bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
166+
if (!timeout_ms) {
167+
esp_yield();
168+
return true;
169+
}
166170
uint32_t expired = millis() - start_ms;
167171
if (expired >= timeout_ms) {
168172
return true; // expired

0 commit comments

Comments
 (0)