diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp index 0d708ff7e..588019f0d 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -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(); } diff --git a/cores/esp8266/core_esp8266_wiring.cpp b/cores/esp8266/core_esp8266_wiring.cpp index 247a02bbd..64b80aed1 100644 --- a/cores/esp8266/core_esp8266_wiring.cpp +++ b/cores/esp8266/core_esp8266_wiring.cpp @@ -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(); diff --git a/libraries/SoftwareSerial b/libraries/SoftwareSerial index f86906b0a..4abc14f42 160000 --- a/libraries/SoftwareSerial +++ b/libraries/SoftwareSerial @@ -1 +1 @@ -Subproject commit f86906b0ade42bb211bbab61c9c948af995cb5d7 +Subproject commit 4abc14f4295f3d2dd296f535c48740339edc6d4d