From a70b849039ad2049efd2a304a269b7f854509c77 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 28 Dec 2021 11:20:45 -0600 Subject: [PATCH] Changed getMacAddr behavior (#1017) --- src/nrf52/main-nrf52.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/nrf52/main-nrf52.cpp b/src/nrf52/main-nrf52.cpp index ab109205..88166e4f 100644 --- a/src/nrf52/main-nrf52.cpp +++ b/src/nrf52/main-nrf52.cpp @@ -38,18 +38,13 @@ void __attribute__((noreturn)) __assert_func(const char *file, int line, const c void getMacAddr(uint8_t *dmac) { - ble_gap_addr_t addr; - if (sd_ble_gap_addr_get(&addr) == NRF_SUCCESS) { - memcpy(dmac, addr.addr, 6); - } else { - const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR; - dmac[5] = src[0]; - dmac[4] = src[1]; - dmac[3] = src[2]; - dmac[2] = src[3]; - dmac[1] = src[4]; - dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack - } + const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR; + dmac[5] = src[0]; + dmac[4] = src[1]; + dmac[3] = src[2]; + dmac[2] = src[3]; + dmac[1] = src[4]; + dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack } static void initBrownout()