1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-05 12:42:22 +03:00

Make delay() as overridable as yield() already is, and add overridable loop_end() (#6306)

* Make delay() overridable "weak"

* Add pluggable loop_end()

* Release tag 5.2.3 for SoftwareSerial
This commit is contained in:
Dirk O. Kaar
2019-07-18 23:40:58 +02:00
committed by Earle F. Philhower, III
parent 2130f3ee8c
commit d9684351c2
3 changed files with 13 additions and 4 deletions

View File

@ -121,6 +121,14 @@ extern "C" void optimistic_yield(uint32_t interval_us) {
}
}
extern "C" void __loop_end (void)
{
run_scheduled_functions();
run_scheduled_recurrent_functions();
}
extern "C" void loop_end (void) __attribute__ ((weak, alias("__loop_end")));
static void loop_wrapper() {
static bool setup_done = false;
preloop_update_frequency();
@ -129,8 +137,7 @@ static void loop_wrapper() {
setup_done = true;
}
loop();
run_scheduled_functions();
run_scheduled_recurrent_functions();
loop_end();
esp_schedule();
}