From 8b4298a4bf4c5b6cf56021385661739744f0037c Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 20 Jul 2022 17:16:36 +1000 Subject: [PATCH] rp2/mpbthciport: Remove mp_bthci_uart from set of root pointers. This is a statically-allocated UART (see machine_uart.c), and doesn't contain any heap pointers other than the ringbufs (which are already root pointers), so no need to track it additionally. Saves needing to add mpbthciport.c to the QSTR sources. Signed-off-by: Jim Mussared --- ports/rp2/mpbthciport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/rp2/mpbthciport.c b/ports/rp2/mpbthciport.c index cd41da017a..91c908b164 100644 --- a/ports/rp2/mpbthciport.c +++ b/ports/rp2/mpbthciport.c @@ -100,8 +100,10 @@ int mp_bluetooth_hci_uart_init(uint32_t port, uint32_t baudrate) { MP_OBJ_NEW_QSTR(MP_QSTR_timeout), MP_OBJ_NEW_SMALL_INT(1000), }; + // This is a statically-allocated UART (see machine_uart.c), and doesn't + // contain any heap pointers other than the ringbufs (which are already + // root pointers), so no need to track this as a root pointer. mp_bthci_uart = machine_uart_type.make_new((mp_obj_t)&machine_uart_type, 2, 2, args); - MP_STATE_PORT(mp_bthci_uart) = mp_bthci_uart; // Start the HCI polling to process any initial events/packets. mp_bluetooth_hci_start_polling(); @@ -197,6 +199,4 @@ MP_WEAK int mp_bluetooth_hci_controller_wakeup(void) { return 0; } -MP_REGISTER_ROOT_POINTER(struct _machine_uart_obj_t *mp_bthci_uart); - #endif // MICROPY_PY_BLUETOOTH