aboutsummaryrefslogtreecommitdiff
path: root/unix/mpconfigport.h
diff options
context:
space:
mode:
Diffstat (limited to 'unix/mpconfigport.h')
-rw-r--r--unix/mpconfigport.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index a74345817..2061b4895 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -210,8 +210,12 @@ void mp_unix_mark_exec(void);
#define MP_PLAT_ALLOC_EXEC(min_size, ptr, size) mp_unix_alloc_exec(min_size, ptr, size)
#define MP_PLAT_FREE_EXEC(ptr, size) mp_unix_free_exec(ptr, size)
+#if MICROPY_PY_OS_DUPTERM
+#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
+#else
#include <unistd.h>
#define MP_PLAT_PRINT_STRN(str, len) do { ssize_t ret = write(1, str, len); (void)ret; } while (0)
+#endif
#ifdef __linux__
// Can access physical memory using /dev/mem
@@ -239,9 +243,19 @@ 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; \
void *mmap_region_head; \
// We need to provide a declaration/definition of alloca()