windows/windows_mphal: Fix mp_hal_delay_ms() so it runs events.

This changed behaviour in c393f5c123 when the
MICROPY_EVENT_POLL_HOOK macro was removed.

Signed-off-by: Damien George <damien@micropython.org>
pull/13356/head
Damien George 2024-01-05 15:56:34 +11:00
rodzic 0640ff3b97
commit 42eab32a36
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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);