Skip to content

Commit 08643ec

Browse files
committed
Revert "(Temporarliy) revert weak delay binding, until"
This reverts commit 9d3250b. Standard Arduino Core calls yield() on delay() periodically. ESP8266 at least calls yield() once on delay(). Not calling yield() at all deviates too much from expected behavior, IMHO. The most reasonable way to provide ESP32 porters of sketches and libraries a similar capability is to make delay() pluggable, such that what is added to yield() can be added to delay() as well.
1 parent 06c2a90 commit 08643ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: cores/esp32/esp32-hal-misc.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,13 @@ unsigned long IRAM_ATTR millis()
141141
return (unsigned long) (esp_timer_get_time() / 1000ULL);
142142
}
143143

144-
void delay(uint32_t ms)
144+
void __delay(uint32_t ms)
145145
{
146146
vTaskDelay(ms / portTICK_PERIOD_MS);
147147
}
148148

149+
void delay(uint32_t ms) __attribute__ ((weak, alias("__delay")));
150+
149151
void IRAM_ATTR delayMicroseconds(uint32_t us)
150152
{
151153
uint32_t m = micros();

0 commit comments

Comments
 (0)