diff options
Diffstat (limited to 'esp8266/esp_mphal.c')
-rw-r--r-- | esp8266/esp_mphal.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index c78b3600f..3fd2c636d 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -30,6 +30,7 @@ #include "uart.h" #include "esp_mphal.h" #include "user_interface.h" +#include "ets_alt_task.h" #include "py/obj.h" #include "py/mpstate.h" @@ -105,6 +106,15 @@ void mp_hal_set_interrupt_char(int c) { interrupt_char = c; } +void ets_event_poll(void) { + ets_loop_iter(); + if (MP_STATE_VM(mp_pending_exception) != NULL) { + mp_obj_t obj = MP_STATE_VM(mp_pending_exception); + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + nlr_raise(obj); + } +} + void __assert_func(const char *file, int line, const char *func, const char *expr) { printf("assert:%s:%d:%s: %s\n", file, line, func, expr); nlr_raise(mp_obj_new_exception_msg(&mp_type_AssertionError, |