diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2020-10-16 10:10:26 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-11-13 17:19:05 +1100 |
commit | de60aa7d6bef3dc25559ae88e36bd05283e927e5 (patch) | |
tree | 28b6b2dbf1a43d55733638c17a544221f4fc11b2 | |
parent | 3d890e7ab4b3d85a6fa9e57a9a596a23eeaa6aa7 (diff) |
unix: Handle pending events/scheduler in MICROPY_EVENT_POLL_HOOK.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r-- | ports/unix/mpconfigport.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 17f489557..d838f42b3 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -363,7 +363,12 @@ struct _mp_bluetooth_nimble_malloc_t; #define MICROPY_END_ATOMIC_SECTION(x) (void)x; mp_thread_unix_end_atomic_section() #endif -#define MICROPY_EVENT_POLL_HOOK mp_hal_delay_us(500); +#define MICROPY_EVENT_POLL_HOOK \ + do { \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ + mp_hal_delay_us(500); \ + } while (0); #include <sched.h> #define MICROPY_UNIX_MACHINE_IDLE sched_yield(); |