mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +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:
parent
2130f3ee8c
commit
d9684351c2
@ -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();
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ void delay_end(void* arg) {
|
||||
esp_schedule();
|
||||
}
|
||||
|
||||
void delay(unsigned long ms) {
|
||||
void __delay(unsigned long ms) {
|
||||
if(ms) {
|
||||
os_timer_setfn(&delay_timer, (os_timer_func_t*) &delay_end, 0);
|
||||
os_timer_arm(&delay_timer, ms, ONCE);
|
||||
@ -56,6 +56,8 @@ void delay(unsigned long ms) {
|
||||
}
|
||||
}
|
||||
|
||||
void delay(unsigned long ms) __attribute__ ((weak, alias("__delay")));
|
||||
|
||||
void micros_overflow_tick(void* arg) {
|
||||
(void) arg;
|
||||
uint32_t m = system_get_time();
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f86906b0ade42bb211bbab61c9c948af995cb5d7
|
||||
Subproject commit 4abc14f4295f3d2dd296f535c48740339edc6d4d
|
Loading…
x
Reference in New Issue
Block a user