Skip to content

Commit 2c728c5

Browse files
dlechdpgeorge
authored andcommitted
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 <david@pybricks.com>
1 parent 32e32bd commit 2c728c5

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

extmod/modbluetooth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,4 +1675,6 @@ int mp_bluetooth_gatts_db_resize(mp_gatts_db_t db, uint16_t handle, size_t len,
16751675
return entry ? 0 : MP_EINVAL;
16761676
}
16771677

1678+
MP_REGISTER_ROOT_POINTER(mp_obj_t bluetooth);
1679+
16781680
#endif // MICROPY_PY_BLUETOOTH

py/mpstate.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,6 @@ typedef struct _mp_state_vm_t {
196196
#include "genhdr/root_pointers.h"
197197
#endif
198198

199-
// root pointers for extmod
200-
201-
#if MICROPY_PY_BLUETOOTH
202-
mp_obj_t bluetooth;
203-
#endif
204-
205199
//
206200
// END ROOT POINTER SECTION
207201
////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)