summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2022-02-07 13:37:37 -0600
committerDamien George <damien@micropython.org>2022-07-19 11:24:42 +1000
commit03fb6718339fb77022a84b25875cc1daf804ac9a (patch)
tree76c1b423a0ca0afccf46cd17d2b15de2c0d7a545
parentc947c2529427fedea2b6d7b1dead8b61f6e8a28d (diff)
unix/mpconfigport: Allow overriding MICROPY_EVENT_POLL_HOOK.
This allows variants to supply their own `MICROPY_EVENT_POLL_HOOK`. Signed-off-by: David Lechner <david@pybricks.com>
-rw-r--r--ports/unix/mpconfigport.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index 6397bcfbf..312c0cce8 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 <sched.h>
#define MICROPY_UNIX_MACHINE_IDLE sched_yield();