Changed getMacAddr behavior (#1017)

This commit is contained in:
Ben Meadors 2021-12-28 11:20:45 -06:00 committed by GitHub
parent 33769b8657
commit a70b849039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,10 +38,6 @@ void __attribute__((noreturn)) __assert_func(const char *file, int line, const c
void getMacAddr(uint8_t *dmac) 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; const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR;
dmac[5] = src[0]; dmac[5] = src[0];
dmac[4] = src[1]; dmac[4] = src[1];
@ -50,7 +46,6 @@ void getMacAddr(uint8_t *dmac)
dmac[1] = src[4]; dmac[1] = src[4];
dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack
} }
}
static void initBrownout() static void initBrownout()
{ {