Skip to content

Commit 463cfa3

Browse files
committed
Add pluggable loop_end()
1 parent e49012b commit 463cfa3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

cores/esp8266/core_esp8266_main.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ extern "C" void optimistic_yield(uint32_t interval_us) {
121121
}
122122
}
123123

124+
extern "C" void __loop_end (void)
125+
{
126+
run_scheduled_functions();
127+
run_scheduled_recurrent_functions();
128+
}
129+
130+
extern "C" void loop_end (void) __attribute__ ((weak, alias("__loop_end")));
131+
124132
static void loop_wrapper() {
125133
static bool setup_done = false;
126134
preloop_update_frequency();
@@ -129,8 +137,7 @@ static void loop_wrapper() {
129137
setup_done = true;
130138
}
131139
loop();
132-
run_scheduled_functions();
133-
run_scheduled_recurrent_functions();
140+
loop_end();
134141
esp_schedule();
135142
}
136143

0 commit comments

Comments
 (0)