From 03fb6718339fb77022a84b25875cc1daf804ac9a Mon Sep 17 00:00:00 2001 From: David Lechner Date: Mon, 7 Feb 2022 13:37:37 -0600 Subject: [PATCH] unix/mpconfigport: Allow overriding MICROPY_EVENT_POLL_HOOK. This allows variants to supply their own `MICROPY_EVENT_POLL_HOOK`. Signed-off-by: David Lechner --- ports/unix/mpconfigport.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 6397bcfbf6..312c0cce8f 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -324,12 +324,14 @@ static inline unsigned long mp_urandom_seed_init(void) { #define MICROPY_END_ATOMIC_SECTION(x) (void)x; mp_thread_unix_end_atomic_section() #endif +#ifndef MICROPY_EVENT_POLL_HOOK #define MICROPY_EVENT_POLL_HOOK \ do { \ extern void mp_handle_pending(bool); \ mp_handle_pending(true); \ usleep(500); /* equivalent to mp_hal_delay_us(500) */ \ } while (0); +#endif #include #define MICROPY_UNIX_MACHINE_IDLE sched_yield();