sforkowany z mirror/meshtastic-firmware
Changed getMacAddr behavior (#1017)
rodzic
33769b8657
commit
a70b849039
|
@ -38,18 +38,13 @@ 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;
|
const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR;
|
||||||
if (sd_ble_gap_addr_get(&addr) == NRF_SUCCESS) {
|
dmac[5] = src[0];
|
||||||
memcpy(dmac, addr.addr, 6);
|
dmac[4] = src[1];
|
||||||
} else {
|
dmac[3] = src[2];
|
||||||
const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR;
|
dmac[2] = src[3];
|
||||||
dmac[5] = src[0];
|
dmac[1] = src[4];
|
||||||
dmac[4] = src[1];
|
dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack
|
||||||
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()
|
static void initBrownout()
|
||||||
|
|
Ładowanie…
Reference in New Issue