From 87bc8e2b3d66d3e87c2d01a7b3107a8ecce2a07f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 15 Jan 2015 10:46:27 +0200 Subject: pyexec: Add event-driven variant pyexec_friendly_repl(). pyexec_friendly_repl_process_char() and friends, useful for ports which integrate into existing cooperative multitasking system. Unlike readline() refactor before, this was implemented in less formal, trial&error process, minor functionality regressions are still known (like soft&hard reset support). So, original loop-based pyexec_friendly_repl() is left intact, specific implementation selectable by config setting. --- stmhal/pyexec.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'stmhal/pyexec.h') diff --git a/stmhal/pyexec.h b/stmhal/pyexec.h index e36027351..d01d505a7 100644 --- a/stmhal/pyexec.h +++ b/stmhal/pyexec.h @@ -32,9 +32,12 @@ typedef enum { extern pyexec_mode_kind_t pyexec_mode_kind; #define PYEXEC_FORCED_EXIT (0x100) +#define PYEXEC_SWITCH_MODE (0x200) int pyexec_raw_repl(void); int pyexec_friendly_repl(void); int pyexec_file(const char *filename); +void pyexec_friendly_repl_init(void); +int pyexec_friendly_repl_process_char(int c); MP_DECLARE_CONST_FUN_OBJ(pyb_set_repl_info_obj); -- cgit v1.2.3