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>
pull/8922/head
David Lechner 2022-07-02 15:05:41 -05:00 zatwierdzone przez Damien George
rodzic 32e32bd761
commit 2c728c5330
2 zmienionych plików z 2 dodań i 6 usunięć

Wyświetl plik

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

Wyświetl plik

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