Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Newton_M3_Universal-full-flash.bin
Binary file not shown.
Binary file modified tag_fw/Newton_M3_Universal-full-flash.bin
Binary file not shown.
Binary file modified tag_fw/Newton_M3_Universal-ota.bin
Binary file not shown.
37 changes: 24 additions & 13 deletions tag_fw/hal/Newton_M3_nRF52811/HAL_Newton_M3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,31 @@ void getTemperature() {
}

void boardGetOwnMac(uint8_t *mac) {
mac[0] = tag.macSuffix & 0xFF;
mac[1] = tag.macSuffix >> 8;
mac[2] = (NRF_UICR->CUSTOMER[0]) & 0xFF;
mac[3] = (NRF_UICR->CUSTOMER[0] >> 8) & 0xFF;
mac[4] = (NRF_UICR->CUSTOMER[0] >> 16) & 0xFF;
mac[5] = (NRF_UICR->CUSTOMER[0] >> 24);
mac[6] = 0;
mac[7] = 0;
uint8_t cksum = 0;
for (uint8_t c = 0; c < 8; c++) {
cksum ^= mac[c];
cksum ^= mac[c] >> 4;
if (NRF_UICR->CUSTOMER[0] == 0xFFFFFFFF) {
mac[0] = (NRF_FICR->DEVICEADDR[1]) & 0xFF;
mac[1] = (NRF_FICR->DEVICEADDR[1] >> 8) & 0xFF;
mac[2] = (NRF_FICR->DEVICEADDR[1] >> 16) & 0xFF;
mac[3] = (NRF_FICR->DEVICEADDR[1] >> 24);
mac[4] = (NRF_FICR->DEVICEADDR[0]) & 0xFF;
mac[5] = (NRF_FICR->DEVICEADDR[0] >> 8) & 0xFF;
mac[6] = (NRF_FICR->DEVICEADDR[0] >> 16) & 0xFF;
mac[7] = (NRF_FICR->DEVICEADDR[0] >> 24);
} else {
mac[0] = tag.macSuffix & 0xFF;
mac[1] = tag.macSuffix >> 8;
mac[2] = (NRF_UICR->CUSTOMER[0]) & 0xFF;
mac[3] = (NRF_UICR->CUSTOMER[0] >> 8) & 0xFF;
mac[4] = (NRF_UICR->CUSTOMER[0] >> 16) & 0xFF;
mac[5] = (NRF_UICR->CUSTOMER[0] >> 24);
mac[6] = 0;
mac[7] = 0;
uint8_t cksum = 0;
for (uint8_t c = 0; c < 8; c++) {
cksum ^= mac[c];
cksum ^= mac[c] >> 4;
}
mac[0] += cksum & 0x0F;
}
mac[0] += cksum & 0x0F;
}

void watchdog_enable(int timeout) {
Expand Down