summaryrefslogtreecommitdiffstatshomepage
path: root/py/runtime.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-16 18:05:06 +1100
committerDamien George <damien.p.george@gmail.com>2017-03-20 15:20:26 +1100
commit6e74d24f30bca3fb70876b1fb9a6b3a59850b83c (patch)
tree391a713749edac08db0efc45e6ff987b2f437dc0 /py/runtime.h
parentbf29fe2e138a30688cfb94ad3859f903f935ced1 (diff)
downloadmicropython-6e74d24f30bca3fb70876b1fb9a6b3a59850b83c.tar.gz
micropython-6e74d24f30bca3fb70876b1fb9a6b3a59850b83c.zip
py: Add micropython.schedule() function and associated runtime code.
Diffstat (limited to 'py/runtime.h')
-rw-r--r--py/runtime.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h
index 954833b67a..d4b1fa79a6 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -64,6 +64,16 @@ extern const qstr mp_binary_op_method_name[];
void mp_init(void);
void mp_deinit(void);
+void mp_handle_pending(void);
+void mp_handle_pending_tail(mp_uint_t atomic_state);
+
+#if MICROPY_ENABLE_SCHEDULER
+void mp_sched_lock(void);
+void mp_sched_unlock(void);
+static inline unsigned int mp_sched_num_pending(void) { return MP_STATE_VM(sched_sp); }
+bool mp_sched_schedule(mp_obj_t function, mp_obj_t arg);
+#endif
+
// extra printing method specifically for mp_obj_t's which are integral type
int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int base_char, int flags, char fill, int width, int prec);