From 2c728c533059a09635a99facfcce18bda8768497 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 2 Jul 2022 15:05:41 -0500 Subject: [PATCH] extmod/modbluetooth: Use MP_REGISTER_ROOT_POINTER(). This uses MP_REGISTER_ROOT_POINTER() to register `bluetooth` instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner --- extmod/modbluetooth.c | 2 ++ py/mpstate.h | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c index 6bdea1616f..9956671863 100644 --- a/extmod/modbluetooth.c +++ b/extmod/modbluetooth.c @@ -1675,4 +1675,6 @@ int mp_bluetooth_gatts_db_resize(mp_gatts_db_t db, uint16_t handle, size_t len, return entry ? 0 : MP_EINVAL; } +MP_REGISTER_ROOT_POINTER(mp_obj_t bluetooth); + #endif // MICROPY_PY_BLUETOOTH diff --git a/py/mpstate.h b/py/mpstate.h index 784eff0a26..a268e8685b 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -196,12 +196,6 @@ typedef struct _mp_state_vm_t { #include "genhdr/root_pointers.h" #endif - // root pointers for extmod - - #if MICROPY_PY_BLUETOOTH - mp_obj_t bluetooth; - #endif - // // END ROOT POINTER SECTION ////////////////////////////////////////////////////////////