shared/readline: Use MP_REGISTER_ROOT_POINTER().

This uses MP_REGISTER_ROOT_POINTER() to register the readline_history root
pointer array used by shared/readline.c and removes the registration from
all mpconfigport.h files.

This also required adding a new MICROPY_READLINE_HISTORY_SIZE config option
since not all ports used the same sized array.

Signed-off-by: David Lechner <david@pybricks.com>
This commit is contained in:
David Lechner
2022-07-01 14:06:10 -05:00
committed by Damien George
parent fc3d7ae11b
commit 81dbea1ce3
28 changed files with 31 additions and 46 deletions

View File

@@ -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)

View File

@@ -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 */ \