Skip to content

Commit

Permalink
extmod/modbluetooth: Use MP_REGISTER_ROOT_POINTER().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dlech authored and dpgeorge committed Jul 18, 2022
1 parent 32e32bd commit 2c728c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions extmod/modbluetooth.c
Expand Up @@ -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
6 changes: 0 additions & 6 deletions py/mpstate.h
Expand Up @@ -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
////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 2c728c5

Please sign in to comment.