diff --git a/cores/esp8266/StackThunk.cpp b/cores/esp8266/StackThunk.cpp index 0d2a8a3541..d9cb0316fe 100644 --- a/cores/esp8266/StackThunk.cpp +++ b/cores/esp8266/StackThunk.cpp @@ -27,15 +27,20 @@ #include #include #include -#include "pgmspace.h" + #include "debug.h" #include "StackThunk.h" + +#include #include + #include #include extern "C" { +extern void optimistic_yield(uint32_t); + uint32_t *stack_thunk_ptr = NULL; uint32_t *stack_thunk_top = NULL; uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */ @@ -150,4 +155,9 @@ void stack_thunk_fatal_smashing() __stack_chk_fail(); } +void stack_thunk_yield() +{ + optimistic_yield(10000); +} + } diff --git a/cores/esp8266/StackThunk.h b/cores/esp8266/StackThunk.h index e72e0efb9f..350775ec24 100644 --- a/cores/esp8266/StackThunk.h +++ b/cores/esp8266/StackThunk.h @@ -31,6 +31,8 @@ extern "C" { #endif +extern void stack_thunk_yield(void); + extern void stack_thunk_add_ref(); extern void stack_thunk_del_ref(); extern void stack_thunk_repaint();