aboutsummaryrefslogtreecommitdiff
path: root/ports/windows
diff options
context:
space:
mode:
authorJim Mussared2020-11-03 23:21:18 +1100
committerDamien George2020-11-13 17:19:05 +1100
commit4559bcb4679e04e0a5e24030675676ff6a9803f2 (patch)
treeb4fa29d87af4487967e8f0c0aa56f224044c38ed /ports/windows
parentde60aa7d6bef3dc25559ae88e36bd05283e927e5 (diff)
unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'ports/windows')
-rw-r--r--ports/windows/windows_mphal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/windows/windows_mphal.c b/ports/windows/windows_mphal.c
index b442b5914..49daa0542 100644
--- a/ports/windows/windows_mphal.c
+++ b/ports/windows/windows_mphal.c
@@ -261,3 +261,9 @@ uint64_t mp_hal_time_ns(void) {
gettimeofday(&tv, NULL);
return (uint64_t)tv.tv_sec * 1000000000ULL + (uint64_t)tv.tv_usec * 1000ULL;
}
+
+// TODO: POSIX et al. define usleep() as guaranteedly capable only of 1s sleep:
+// "The useconds argument shall be less than one million."
+void mp_hal_delay_ms(mp_uint_t ms) {
+ usleep((ms) * 1000);
+}