summaryrefslogtreecommitdiff
path: root/extmod/btstack/modbluetooth_btstack.c
diff options
context:
space:
mode:
authorPeter Harper <peter.harper@raspberrypi.com>2023-03-13 10:39:06 +0000
committerDamien George <damien@micropython.org>2023-06-14 22:20:20 +1000
commitba83f6d50c0da30e159d266232457d8c1d281179 (patch)
tree632a20710b437157ad3d089ad434afb356e846fb /extmod/btstack/modbluetooth_btstack.c
parenta459eaf3e6a8d0e0f36c885c994819a296a64e71 (diff)
extmod/btstack: Fix marking of static addresses in set_random_address.
Marking address as static was not applied to all code paths. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/btstack/modbluetooth_btstack.c')
-rw-r--r--extmod/btstack/modbluetooth_btstack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c
index 183c85a44..0c15e9343 100644
--- a/extmod/btstack/modbluetooth_btstack.c
+++ b/extmod/btstack/modbluetooth_btstack.c
@@ -544,8 +544,6 @@ STATIC void set_random_address(void) {
DEBUG_printf("set_random_address: Generating static address using mp_hal_get_mac\n");
mp_hal_get_mac(MP_HAL_MAC_BDADDR, static_addr);
- // Mark it as STATIC (not RPA or NRPA).
- static_addr[0] |= 0xc0;
#else
@@ -558,6 +556,8 @@ STATIC void set_random_address(void) {
}
#endif // MICROPY_BLUETOOTH_USE_MP_HAL_GET_MAC_STATIC_ADDRESS
+ // Mark it as STATIC (not RPA or NRPA).
+ static_addr[0] |= 0xc0;
DEBUG_printf("set_random_address: Address generated.\n");
gap_random_address_set(static_addr);