diff options
author | Damien George <damien.p.george@gmail.com> | 2020-02-06 01:05:47 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-02-07 16:08:20 +1100 |
commit | 98a3911c430b0cc96e1821d7ca589b9be3355fc3 (patch) | |
tree | 1182ab05b8366c85f40700548bd003d2a6bd3597 /ports/esp32 | |
parent | 7a5752a7489f6be1c7307455b33119888392a09d (diff) |
py/scheduler: Add "raise_exc" argument to mp_handle_pending.
Previous behaviour is when this argument is set to "true", in which case
the function will raise any pending exception. Setting it to "false" will
cancel any pending exception.
Diffstat (limited to 'ports/esp32')
-rw-r--r-- | ports/esp32/modsocket.c | 2 | ||||
-rw-r--r-- | ports/esp32/mpconfigport.h | 8 | ||||
-rw-r--r-- | ports/esp32/mphalport.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/ports/esp32/modsocket.c b/ports/esp32/modsocket.c index e11af60e2..60a028c13 100644 --- a/ports/esp32/modsocket.c +++ b/ports/esp32/modsocket.c @@ -162,7 +162,7 @@ NORETURN static void exception_from_errno(int _errno) { } static inline void check_for_exceptions(void) { - mp_handle_pending(); + mp_handle_pending(true); } // This function mimics lwip_getaddrinfo, with added support for mDNS queries diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h index 983c882ae..96e47fbba 100644 --- a/ports/esp32/mpconfigport.h +++ b/ports/esp32/mpconfigport.h @@ -244,8 +244,8 @@ void *esp_native_code_commit(void*, size_t, void*); #if MICROPY_PY_THREAD #define MICROPY_EVENT_POLL_HOOK \ do { \ - extern void mp_handle_pending(void); \ - mp_handle_pending(); \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ MICROPY_PY_USOCKET_EVENTS_HANDLER \ MP_THREAD_GIL_EXIT(); \ MP_THREAD_GIL_ENTER(); \ @@ -253,8 +253,8 @@ void *esp_native_code_commit(void*, size_t, void*); #else #define MICROPY_EVENT_POLL_HOOK \ do { \ - extern void mp_handle_pending(void); \ - mp_handle_pending(); \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ MICROPY_PY_USOCKET_EVENTS_HANDLER \ asm("waiti 0"); \ } while (0); diff --git a/ports/esp32/mphalport.c b/ports/esp32/mphalport.c index 305e87593..c701cb4bc 100644 --- a/ports/esp32/mphalport.c +++ b/ports/esp32/mphalport.c @@ -157,7 +157,7 @@ void mp_hal_delay_us(uint32_t us) { if (dt + pend_overhead < us) { // we have enough time to service pending events // (don't use MICROPY_EVENT_POLL_HOOK because it also yields) - mp_handle_pending(); + mp_handle_pending(true); } } } |