From ccda7686a436f4d172325cce1fbf1d49165e31fd Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 1 Jul 2022 15:51:12 -0500 Subject: [PATCH] zephyr: Use MP_REGISTER_ROOT_POINTER(). This uses MP_REGISTER_ROOT_POINTER() to register port-specific root pointers for the zephyr port. Signed-off-by: David Lechner --- ports/zephyr/machine_pin.c | 3 +++ ports/zephyr/modbluetooth_zephyr.c | 2 ++ ports/zephyr/mpconfigport.h | 4 ---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ports/zephyr/machine_pin.c b/ports/zephyr/machine_pin.c index dee66a5c69..aa55c04104 100644 --- a/ports/zephyr/machine_pin.c +++ b/ports/zephyr/machine_pin.c @@ -322,4 +322,7 @@ STATIC const mp_irq_methods_t machine_pin_irq_methods = { .info = machine_pin_irq_info, }; +/* Linked list of pin irq objects */ +MP_REGISTER_ROOT_POINTER(void *machine_pin_irq_list); + #endif // MICROPY_PY_MACHINE diff --git a/ports/zephyr/modbluetooth_zephyr.c b/ports/zephyr/modbluetooth_zephyr.c index ba13064f33..4d4b19a1d9 100644 --- a/ports/zephyr/modbluetooth_zephyr.c +++ b/ports/zephyr/modbluetooth_zephyr.c @@ -418,4 +418,6 @@ int mp_bluetooth_gap_peripheral_connect_cancel(void) { #endif // MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE +MP_REGISTER_ROOT_POINTER(struct _mp_bluetooth_zephyr_root_pointers_t *bluetooth_zephyr_root_pointers); + #endif // MICROPY_PY_BLUETOOTH diff --git a/ports/zephyr/mpconfigport.h b/ports/zephyr/mpconfigport.h index 1be755baab..586b0ec916 100644 --- a/ports/zephyr/mpconfigport.h +++ b/ports/zephyr/mpconfigport.h @@ -133,10 +133,6 @@ typedef long mp_off_t; #define MP_STATE_PORT MP_STATE_VM -#define MICROPY_PORT_ROOT_POINTERS \ - void *machine_pin_irq_list; /* Linked list of pin irq objects */ \ - struct _mp_bluetooth_zephyr_root_pointers_t *bluetooth_zephyr_root_pointers; - // extra built in names to add to the global namespace #define MICROPY_PORT_BUILTINS \ { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },