Skip to content

Commit

Permalink
windows/windows_mphal: Fix mp_hal_delay_ms() so it runs events.
Browse files Browse the repository at this point in the history
This changed behaviour in c393f5c when the
MICROPY_EVENT_POLL_HOOK macro was removed.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Jan 5, 2024
1 parent 0640ff3 commit 42eab32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/windows/windows_mphal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 42eab32

Please sign in to comment.