esp8266: Enable micropython.schedule() with locking in pin callback.
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c
index f5e284f..7ecc777 100644
--- a/esp8266/esp_mphal.c
+++ b/esp8266/esp_mphal.c
@@ -33,6 +33,7 @@
#include "ets_alt_task.h"
#include "py/obj.h"
#include "py/mpstate.h"
+#include "py/runtime.h"
#include "extmod/misc.h"
#include "lib/utils/pyexec.h"
@@ -130,11 +131,7 @@
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);
- }
+ mp_handle_pending();
}
void __assert_func(const char *file, int line, const char *func, const char *expr) {