diff options
| author | Damien George <damien@micropython.org> | 2021-04-28 10:48:04 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-04-30 15:13:43 +1000 |
| commit | a41cd150be01adc59828ead26a01a9d9324773e1 (patch) | |
| tree | 17aa446c193e54f44d04dd122ce0d7debeb9c526 | |
| parent | a1111b83ed00542b4f5651d3aae9d38ecbbb6dd6 (diff) | |
esp8266/modnetwork: Use mp_handle_pending() to raise pending exception.
If MICROPY_ENABLE_SCHEDULER is enabled then MP_STATE_VM(sched_state) must
be updated after handling the pending exception, which is done by the
mp_handle_pending() function.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/esp8266/modnetwork.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ports/esp8266/modnetwork.c b/ports/esp8266/modnetwork.c index cad53d912..3b8ef4b21 100644 --- a/ports/esp8266/modnetwork.c +++ b/ports/esp8266/modnetwork.c @@ -239,9 +239,7 @@ STATIC mp_obj_t esp_scan(mp_obj_t self_in) { // esp_scan_list variable to NULL without disabling interrupts if (MP_STATE_VM(mp_pending_exception) != NULL) { esp_scan_list = 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(true); } ets_loop_iter(); } |
