Skip to content

Commit 65e43d7

Browse files
andrewleechpi-anl
authored andcommitted
windows/schedule: Add micropython.schedule to windows port.
1 parent f498a16 commit 65e43d7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ports/windows/mpconfigport.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@
165165
#define MICROPY_ERROR_PRINTER (&mp_stderr_print)
166166
#define MICROPY_WARNINGS (1)
167167
#define MICROPY_PY_STR_BYTES_CMP_WARN (1)
168+
#ifndef MICROPY_ENABLE_SCHEDULER
169+
#define MICROPY_ENABLE_SCHEDULER (1)
170+
#endif
168171

169172
// VFS stat functions should return time values relative to 1970/1/1
170173
#define MICROPY_EPOCH_IS_1970 (1)
@@ -220,6 +223,15 @@ typedef long mp_off_t;
220223

221224
#define MICROPY_MPHALPORT_H "windows_mphal.h"
222225

226+
#if MICROPY_ENABLE_SCHEDULER
227+
#define MICROPY_EVENT_POLL_HOOK \
228+
do { \
229+
extern void mp_handle_pending(bool); \
230+
mp_handle_pending(true); \
231+
mp_hal_delay_us(500); \
232+
} while (0);
233+
#endif
234+
223235
// We need to provide a declaration/definition of alloca()
224236
#include <malloc.h>
225237

0 commit comments

Comments
 (0)