unix: Handle pending events/scheduler in MICROPY_EVENT_POLL_HOOK.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
parent
3d890e7ab4
commit
de60aa7d6b
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user