From 42eab32a36f70840c7e670a61269fb795d43991b Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 5 Jan 2024 15:56:34 +1100 Subject: [PATCH] windows/windows_mphal: Fix mp_hal_delay_ms() so it runs events. This changed behaviour in c393f5c12321a80bea40af7ef2e42a077df5d806 when the MICROPY_EVENT_POLL_HOOK macro was removed. Signed-off-by: Damien George --- ports/windows/windows_mphal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/windows/windows_mphal.c b/ports/windows/windows_mphal.c index f88491707f..dcee20784e 100644 --- a/ports/windows/windows_mphal.c +++ b/ports/windows/windows_mphal.c @@ -279,10 +279,10 @@ int usleep(__int64 usec) { #endif void mp_hal_delay_ms(mp_uint_t ms) { - #ifdef MICROPY_EVENT_POLL_HOOK + #if MICROPY_ENABLE_SCHEDULER mp_uint_t start = mp_hal_ticks_ms(); while (mp_hal_ticks_ms() - start < ms) { - MICROPY_EVENT_POLL_HOOK + mp_event_wait_ms(1); } #else msec_sleep((double)ms);