mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +00:00
fix nrf52 macaddr byte order
This commit is contained in:
parent
5b0451f25c
commit
0c7c3f17e5
@ -30,8 +30,13 @@ void getMacAddr(uint8_t *dmac)
|
||||
assert(res == NRF_SUCCESS);
|
||||
memcpy(dmac, addr.addr, 6);
|
||||
#else
|
||||
// FIXME - byte order might be wrong and high bits might be wrong
|
||||
memcpy(dmac, (const void *)NRF_FICR->DEVICEADDR, 6);
|
||||
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
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user