diff options
| author | Damien George <damien@micropython.org> | 2024-01-05 15:56:34 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-01-05 15:56:34 +1100 |
| commit | 42eab32a36f70840c7e670a61269fb795d43991b (patch) | |
| tree | 7201ed7652cd9aa30489c1fd094d3210a72fa83e | |
| parent | 0640ff3b97f608a9f55ac380c6681cc48cc1e737 (diff) | |
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 <damien@micropython.org>
| -rw-r--r-- | ports/windows/windows_mphal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/windows/windows_mphal.c b/ports/windows/windows_mphal.c index f88491707..dcee20784 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); |
