aboutsummaryrefslogtreecommitdiff
path: root/ports/unix/mpconfigport.h
diff options
context:
space:
mode:
authorJim Mussared2020-04-07 14:42:36 +1000
committerDamien George2020-04-29 16:37:46 +1000
commitcb5994d96e45f26fab4abf5b52ea0f419a060641 (patch)
tree817c5d0c012dbee80a3c6c4b1f7d0cafbc0ac4ed /ports/unix/mpconfigport.h
parent4fa6d939d653b257341ace6ac8c168564549e4ac (diff)
unix/modmachine: Add machine.idle(), implemented using sched_yield.
Also add a definition of MICROPY_EVENT_POLL_HOOK so the unix port can build against modules that require this.
Diffstat (limited to 'ports/unix/mpconfigport.h')
-rw-r--r--ports/unix/mpconfigport.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index 301917a61..b23b6ce47 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -349,4 +349,9 @@ void mp_unix_mark_exec(void);
#define MICROPY_END_ATOMIC_SECTION(x) (void)x; mp_thread_unix_end_atomic_section()
#endif
+#define MICROPY_EVENT_POLL_HOOK mp_hal_delay_us(500);
+
+#include <sched.h>
+#define MICROPY_UNIX_MACHINE_IDLE sched_yield();
+
#endif // MICROPY_UNIX_MINIMAL