Skip to content

Commit 9bbfd5e

Browse files
committed
py/mpconfig: Make configuration of dupterm object reusable.
1 parent ddea7cb commit 9bbfd5e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

py/mpconfig.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,12 @@ typedef double mp_float_t;
819819
#define MICROPY_PORT_ROOT_POINTERS
820820
#endif
821821

822+
#if MICROPY_PY_OS_DUPTERM
823+
#define MP_ROOT_PTR_DUPTERM_OBJ mp_obj_t term_obj
824+
#else
825+
#define MP_ROOT_PTR_DUPTERM_OBJ
826+
#endif
827+
822828
/*****************************************************************************/
823829
/* Miscellaneous settings */
824830

unix/mpconfigport.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,16 @@ extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
244244
#define MP_STATE_PORT MP_STATE_VM
245245

246246
#if MICROPY_PY_OS_DUPTERM
247-
#define ROOT_POINTERS_1 mp_obj_t term_obj
248247
#include <stddef.h>
249248
void mp_hal_dupterm_tx_strn(const char *str, size_t len);
250249
#else
251-
#define ROOT_POINTERS_1
252250
#define mp_hal_dupterm_tx_strn(s, l)
253251
#endif
254252

255253
#define MICROPY_PORT_ROOT_POINTERS \
256254
const char *readline_hist[50]; \
257255
mp_obj_t keyboard_interrupt_obj; \
258-
ROOT_POINTERS_1; \
256+
MP_ROOT_PTR_DUPTERM_OBJ; \
259257
void *mmap_region_head; \
260258

261259
// We need to provide a declaration/definition of alloca()

0 commit comments

Comments
 (0)