summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2022-07-01 14:18:09 -0500
committerDamien George <damien@micropython.org>2022-07-18 13:49:51 +1000
commit8fa6191f955c81678ac4ec3b45f92a72c641f0b1 (patch)
tree01655138d7720da55bd623ec11d0b773d7a77b05
parentac86e8449afebdef38b02af7acfc0ed535db9d94 (diff)
extmod/btstack: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register bluetooth_btstack_root_pointers and removes the same from all mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
-rw-r--r--extmod/btstack/modbluetooth_btstack.c2
-rw-r--r--ports/stm32/mpconfigport.h8
-rw-r--r--ports/unix/mpconfigport.h4
3 files changed, 2 insertions, 12 deletions
diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c
index e56e488b1..c07cc8c10 100644
--- a/extmod/btstack/modbluetooth_btstack.c
+++ b/extmod/btstack/modbluetooth_btstack.c
@@ -1460,4 +1460,6 @@ int mp_bluetooth_l2cap_recvinto(uint16_t conn_handle, uint16_t cid, uint8_t *buf
#endif // MICROPY_PY_BLUETOOTH_ENABLE_L2CAP_CHANNELS
+MP_REGISTER_ROOT_POINTER(struct _mp_bluetooth_btstack_root_pointers_t *bluetooth_btstack_root_pointers);
+
#endif // MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index 4afad339b..9c719b8d0 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -246,13 +246,6 @@ struct _mp_bluetooth_nimble_malloc_t;
#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE
#endif
-#if MICROPY_BLUETOOTH_BTSTACK
-struct _mp_bluetooth_btstack_root_pointers_t;
-#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH_BTSTACK struct _mp_bluetooth_btstack_root_pointers_t *bluetooth_btstack_root_pointers;
-#else
-#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH_BTSTACK
-#endif
-
#ifndef MICROPY_BOARD_ROOT_POINTERS
#define MICROPY_BOARD_ROOT_POINTERS
#endif
@@ -292,7 +285,6 @@ struct _mp_bluetooth_btstack_root_pointers_t;
\
/* root pointers for sub-systems */ \
MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE \
- MICROPY_PORT_ROOT_POINTER_BLUETOOTH_BTSTACK \
\
/* root pointers defined by a board */ \
MICROPY_BOARD_ROOT_POINTERS \
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index eb2da2393..e020e54bf 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -291,10 +291,6 @@ static inline unsigned long mp_urandom_seed_init(void) {
#define MP_STATE_PORT MP_STATE_VM
#if MICROPY_PY_BLUETOOTH
-#if MICROPY_BLUETOOTH_BTSTACK
-struct _mp_bluetooth_btstack_root_pointers_t;
-#define MICROPY_BLUETOOTH_ROOT_POINTERS struct _mp_bluetooth_btstack_root_pointers_t *bluetooth_btstack_root_pointers;
-#endif
#if MICROPY_BLUETOOTH_NIMBLE
struct _mp_bluetooth_nimble_root_pointers_t;
struct _mp_bluetooth_nimble_malloc_t;