Skip to content

Commit 7793250

Browse files
committed
windows: Implement MICROPY_INTERNAL_WFE() macro.
This should be the equivalent of the previous event poll hook macro. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 49a9a59 commit 7793250

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ports/windows/mpconfigport.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,9 @@ typedef long mp_off_t;
227227
#if MICROPY_ENABLE_SCHEDULER
228228
// Use 1mSec sleep to make sure there is effectively a wait period:
229229
// something like usleep(500) truncates and ends up calling Sleep(0).
230-
#define MICROPY_EVENT_POLL_HOOK \
231-
do { \
232-
extern void mp_handle_pending(bool); \
233-
mp_handle_pending(true); \
234-
msec_sleep(1.0); \
235-
} while (0);
230+
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) msec_sleep(MIN(1.0, (double)(TIMEOUT_MS)))
231+
#else
232+
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) /* No-op */
236233
#endif
237234

238235
#ifdef __GNUC__

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy