diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-01-01 13:15:18 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-01-01 13:16:18 +0200 |
commit | 9bbfd5efd49df9e4d6d2dddec71ad2572430f43f (patch) | |
tree | 8857d43f7d6b72a1ab0bf99c3b3005e5da4ec488 | |
parent | ddea7cb702db6ff350602b2bdd2193f149570060 (diff) | |
download | micropython-9bbfd5efd49df9e4d6d2dddec71ad2572430f43f.tar.gz micropython-9bbfd5efd49df9e4d6d2dddec71ad2572430f43f.zip |
py/mpconfig: Make configuration of dupterm object reusable.
-rw-r--r-- | py/mpconfig.h | 6 | ||||
-rw-r--r-- | unix/mpconfigport.h | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 5e717ad0f6..08dd497c5f 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -819,6 +819,12 @@ typedef double mp_float_t; #define MICROPY_PORT_ROOT_POINTERS #endif +#if MICROPY_PY_OS_DUPTERM +#define MP_ROOT_PTR_DUPTERM_OBJ mp_obj_t term_obj +#else +#define MP_ROOT_PTR_DUPTERM_OBJ +#endif + /*****************************************************************************/ /* Miscellaneous settings */ diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 2061b48950..a5f32a0812 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -244,18 +244,16 @@ extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj; #define MP_STATE_PORT MP_STATE_VM #if MICROPY_PY_OS_DUPTERM -#define ROOT_POINTERS_1 mp_obj_t term_obj #include <stddef.h> void mp_hal_dupterm_tx_strn(const char *str, size_t len); #else -#define ROOT_POINTERS_1 #define mp_hal_dupterm_tx_strn(s, l) #endif #define MICROPY_PORT_ROOT_POINTERS \ const char *readline_hist[50]; \ mp_obj_t keyboard_interrupt_obj; \ - ROOT_POINTERS_1; \ + MP_ROOT_PTR_DUPTERM_OBJ; \ void *mmap_region_head; \ // We need to provide a declaration/definition of alloca() |