diff options
Diffstat (limited to 'ports')
| -rw-r--r-- | ports/cc3200/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/esp32/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/esp8266/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/javascript/Makefile | 2 | ||||
| -rw-r--r-- | ports/javascript/mpconfigport.h | 3 | ||||
| -rw-r--r-- | ports/mimxrt/Makefile | 1 | ||||
| -rw-r--r-- | ports/mimxrt/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/minimal/Makefile | 1 | ||||
| -rw-r--r-- | ports/minimal/mpconfigport.h | 3 | ||||
| -rw-r--r-- | ports/nrf/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/pic16bit/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/powerpc/Makefile | 2 | ||||
| -rw-r--r-- | ports/powerpc/mpconfigport.h | 3 | ||||
| -rw-r--r-- | ports/renesas-ra/mpconfigport.h | 2 | ||||
| -rw-r--r-- | ports/rp2/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | ports/rp2/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/samd/Makefile | 1 | ||||
| -rw-r--r-- | ports/samd/mpconfigport.h | 3 | ||||
| -rw-r--r-- | ports/stm32/mpconfigport.h | 2 | ||||
| -rw-r--r-- | ports/teensy/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/unix/mpconfigport.h | 4 | ||||
| -rw-r--r-- | ports/windows/mpconfigport.h | 12 | ||||
| -rw-r--r-- | ports/zephyr/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/zephyr/mpconfigport_minimal.h | 3 |
24 files changed, 16 insertions, 36 deletions
diff --git a/ports/cc3200/mpconfigport.h b/ports/cc3200/mpconfigport.h index 58ec80a9f..ce708cb3f 100644 --- a/ports/cc3200/mpconfigport.h +++ b/ports/cc3200/mpconfigport.h @@ -142,7 +142,6 @@ // vm state and root pointers for the gc #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ mp_obj_t mp_const_user_interrupt; \ mp_obj_t machine_config_main; \ mp_obj_list_t pyb_sleep_obj_list; \ diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h index 1877a0143..a374d8120 100644 --- a/ports/esp32/mpconfigport.h +++ b/ports/esp32/mpconfigport.h @@ -146,7 +146,6 @@ struct mp_bluetooth_nimble_root_pointers_t; #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ mp_obj_t machine_pin_irq_handler[40]; \ struct _machine_timer_obj_t *machine_timer_obj_head; \ struct _machine_i2s_obj_t *machine_i2s_obj[I2S_NUM_MAX]; \ diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index 7727f7845..3f1db723a 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -148,7 +148,6 @@ extern const struct _mp_print_t mp_debug_print; #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ mp_obj_t pin_irq_handler[16]; \ byte *uart0_rxbuf; \ diff --git a/ports/javascript/Makefile b/ports/javascript/Makefile index aea9d6ec3..046d30333 100644 --- a/ports/javascript/Makefile +++ b/ports/javascript/Makefile @@ -30,7 +30,7 @@ SRC_C = \ mphalport.c \ modutime.c \ -SRC_QSTR += $(SRC_C) +SRC_QSTR += $(SRC_C) $(SRC_SHARED) OBJ += $(PY_O) OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED:.c=.o)) diff --git a/ports/javascript/mpconfigport.h b/ports/javascript/mpconfigport.h index 4a6cb4588..01a61e391 100644 --- a/ports/javascript/mpconfigport.h +++ b/ports/javascript/mpconfigport.h @@ -182,6 +182,3 @@ typedef long mp_off_t; #define MICROPY_HW_MCU_NAME "Emscripten" #define MP_STATE_PORT MP_STATE_VM - -#define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; diff --git a/ports/mimxrt/Makefile b/ports/mimxrt/Makefile index 7ae3f9183..be1c95ba9 100644 --- a/ports/mimxrt/Makefile +++ b/ports/mimxrt/Makefile @@ -290,6 +290,7 @@ SRC_QSTR += \ modmimxrt.c \ modutime.c \ pin.c \ + shared/readline/readline.c \ shared/runtime/mpirq.c \ shared/runtime/sys_stdio_mphal.c \ $(GEN_PINS_SRC) diff --git a/ports/mimxrt/mpconfigport.h b/ports/mimxrt/mpconfigport.h index 1dcaccad4..3bff3e474 100644 --- a/ports/mimxrt/mpconfigport.h +++ b/ports/mimxrt/mpconfigport.h @@ -242,7 +242,6 @@ extern const struct _mp_obj_type_t network_lan_type; #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ struct _machine_timer_obj_t *timer_table[MICROPY_HW_PIT_NUM_CHANNELS]; \ void *machine_pin_irq_objects[MICROPY_HW_NUM_PIN_IRQS]; \ /* list of registered NICs */ \ diff --git a/ports/minimal/Makefile b/ports/minimal/Makefile index fc3730e70..ac74925b5 100644 --- a/ports/minimal/Makefile +++ b/ports/minimal/Makefile @@ -68,6 +68,7 @@ SRC_C += $(SRC_MOD) SRC_CXX += $(SRC_MOD_CXX) +SRC_QSTR += shared/readline/readline.c SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) diff --git a/ports/minimal/mpconfigport.h b/ports/minimal/mpconfigport.h index 7d6a3aded..02312e2e4 100644 --- a/ports/minimal/mpconfigport.h +++ b/ports/minimal/mpconfigport.h @@ -41,6 +41,3 @@ typedef long mp_off_t; #endif #define MP_STATE_PORT MP_STATE_VM - -#define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 0698a52ce..fcbe71c5a 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -332,7 +332,6 @@ typedef long mp_off_t; #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ mp_obj_t pin_class_mapper; \ mp_obj_t pin_class_map_dict; \ mp_obj_t pin_irq_handlers[NUM_OF_PINS]; \ diff --git a/ports/pic16bit/mpconfigport.h b/ports/pic16bit/mpconfigport.h index e97a46502..e03fb81a6 100644 --- a/ports/pic16bit/mpconfigport.h +++ b/ports/pic16bit/mpconfigport.h @@ -92,7 +92,6 @@ typedef int mp_off_t; #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ - char *readline_hist[8]; \ mp_obj_t keyboard_interrupt_obj; \ #define MICROPY_MPHALPORT_H "pic16bit_mphal.h" diff --git a/ports/powerpc/Makefile b/ports/powerpc/Makefile index a1e6fa4da..f1ebd6764 100644 --- a/ports/powerpc/Makefile +++ b/ports/powerpc/Makefile @@ -42,6 +42,8 @@ SRC_C = \ shared/runtime/stdout_helpers.c \ $(BUILD)/_frozen_mpy.c \ +SRC_QSTR += shared/readline/readline.c + OBJ = $(PY_CORE_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(BUILD)/head.o diff --git a/ports/powerpc/mpconfigport.h b/ports/powerpc/mpconfigport.h index 0b868e3da..084a461a4 100644 --- a/ports/powerpc/mpconfigport.h +++ b/ports/powerpc/mpconfigport.h @@ -112,9 +112,6 @@ typedef long mp_off_t; #define MP_STATE_PORT MP_STATE_VM -#define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; - // powerpc64 gcc doesn't seem to define these // These are pointers, so make them 64 bit types typedef long intptr_t; diff --git a/ports/renesas-ra/mpconfigport.h b/ports/renesas-ra/mpconfigport.h index 64caa69fd..11b106999 100644 --- a/ports/renesas-ra/mpconfigport.h +++ b/ports/renesas-ra/mpconfigport.h @@ -168,8 +168,6 @@ #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ - \ mp_obj_t pyb_hid_report_desc; \ \ mp_obj_t pyb_config_main; \ diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt index 202261f9c..8f7895459 100644 --- a/ports/rp2/CMakeLists.txt +++ b/ports/rp2/CMakeLists.txt @@ -130,6 +130,7 @@ set(MICROPY_SOURCE_PORT set(MICROPY_SOURCE_QSTR ${MICROPY_SOURCE_PY} + ${MICROPY_DIR}/shared/readline/readline.c ${MICROPY_DIR}/shared/runtime/mpirq.c ${MICROPY_DIR}/shared/runtime/sys_stdio_mphal.c ${PROJECT_SOURCE_DIR}/machine_adc.c diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h index 1a63476c7..1e8510484 100644 --- a/ports/rp2/mpconfigport.h +++ b/ports/rp2/mpconfigport.h @@ -231,7 +231,6 @@ extern const struct _mod_network_nic_type_t mod_network_nic_type_wiznet5k; #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ void *machine_pin_irq_obj[30]; \ void *rp2_pio_irq_obj[2]; \ void *rp2_state_machine_irq_obj[8]; \ diff --git a/ports/samd/Makefile b/ports/samd/Makefile index 17dd81169..b3d6d8b22 100644 --- a/ports/samd/Makefile +++ b/ports/samd/Makefile @@ -127,6 +127,7 @@ SRC_QSTR += \ machine_led.c \ modsamd.c \ samd_flash.c \ + shared/readline/readline.c \ SRC_QSTR += $(SRC_MOD) $(SRC_CXX) diff --git a/ports/samd/mpconfigport.h b/ports/samd/mpconfigport.h index 1625496a2..96d34bf4d 100644 --- a/ports/samd/mpconfigport.h +++ b/ports/samd/mpconfigport.h @@ -99,9 +99,6 @@ #define mp_type_fileio mp_type_vfs_lfs1_fileio #define mp_type_textio mp_type_vfs_lfs1_textio -#define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; - #define MP_STATE_PORT MP_STATE_VM // Miscellaneous settings diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h index a87fe3768..4afad339b 100644 --- a/ports/stm32/mpconfigport.h +++ b/ports/stm32/mpconfigport.h @@ -258,8 +258,6 @@ struct _mp_bluetooth_btstack_root_pointers_t; #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ - \ mp_obj_t pyb_hid_report_desc; \ \ mp_obj_t pyb_config_main; \ diff --git a/ports/teensy/mpconfigport.h b/ports/teensy/mpconfigport.h index db1f56757..b870263df 100644 --- a/ports/teensy/mpconfigport.h +++ b/ports/teensy/mpconfigport.h @@ -42,7 +42,6 @@ extern const struct _mp_obj_module_t pyb_module; #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ mp_obj_t pin_class_mapper; \ mp_obj_t pin_class_map_dict; \ struct _pyb_uart_obj_t *pyb_stdio_uart; \ diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 232bfb857..4594b8be9 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -129,6 +129,9 @@ #define MICROPY_READER_POSIX (1) #define MICROPY_READER_VFS (1) #define MICROPY_USE_READLINE_HISTORY (1) +#ifndef MICROPY_READLINE_HISTORY_SIZE +#define MICROPY_READLINE_HISTORY_SIZE 50 +#endif #define MICROPY_HELPER_LEXER_UNIX (1) #ifndef MICROPY_FLOAT_IMPL #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) @@ -302,7 +305,6 @@ struct _mp_bluetooth_nimble_malloc_t; #endif #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[50]; \ void *mmap_region_head; \ MICROPY_BLUETOOTH_ROOT_POINTERS \ diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h index 47292b3bb..39f8c0059 100644 --- a/ports/windows/mpconfigport.h +++ b/ports/windows/mpconfigport.h @@ -33,6 +33,12 @@ #ifndef MICROPY_USE_READLINE #define MICROPY_USE_READLINE (1) #endif +#ifndef MICROPY_USE_READLINE_HISTORY +#define MICROPY_USE_READLINE_HISTORY (1) +#endif +#ifndef MICROPY_READLINE_HISTORY_SIZE +#define MICROPY_READLINE_HISTORY_SIZE (50) +#endif #define MICROPY_ALLOC_PATH_MAX (260) // see minwindef.h for msvc or limits.h for mingw #define MICROPY_PERSISTENT_CODE_LOAD (1) @@ -52,7 +58,6 @@ #define MICROPY_DEBUG_PRINTERS (1) #define MICROPY_READER_POSIX (1) #define MICROPY_READER_VFS (1) -#define MICROPY_USE_READLINE_HISTORY (1) #define MICROPY_HELPER_REPL (1) #define MICROPY_REPL_EMACS_KEYS (1) #define MICROPY_REPL_AUTO_INDENT (1) @@ -210,11 +215,6 @@ typedef long long mp_off_t; typedef long mp_off_t; #endif -#if MICROPY_USE_READLINE == 1 -#define MICROPY_PORT_ROOT_POINTERS \ - char *readline_hist[50]; -#endif - #define MP_STATE_PORT MP_STATE_VM #define MICROPY_MPHALPORT_H "windows_mphal.h" diff --git a/ports/zephyr/mpconfigport.h b/ports/zephyr/mpconfigport.h index 26610ccce..1be755baa 100644 --- a/ports/zephyr/mpconfigport.h +++ b/ports/zephyr/mpconfigport.h @@ -134,7 +134,6 @@ typedef long mp_off_t; #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; \ void *machine_pin_irq_list; /* Linked list of pin irq objects */ \ struct _mp_bluetooth_zephyr_root_pointers_t *bluetooth_zephyr_root_pointers; diff --git a/ports/zephyr/mpconfigport_minimal.h b/ports/zephyr/mpconfigport_minimal.h index f0e57d756..e819d5cf4 100644 --- a/ports/zephyr/mpconfigport_minimal.h +++ b/ports/zephyr/mpconfigport_minimal.h @@ -83,6 +83,3 @@ typedef unsigned mp_uint_t; // must be pointer size typedef long mp_off_t; #define MP_STATE_PORT MP_STATE_VM - -#define MICROPY_PORT_ROOT_POINTERS \ - const char *readline_hist[8]; |
