extract original mac from firmware (1.54" and 2.9") and make it 2 bytes longer based on info in settings.h
| 285 | |
| 286 | // extract original mac from firmware (1.54" and 2.9") and make it 2 bytes longer based on info in settings.h |
| 287 | void flasher::get_mac_format1() { |
| 288 | zbs->select_flash(0); |
| 289 | for (uint8_t c = 0; c < 6; c++) { |
| 290 | mac[c + 2] = zbs->read_flash(mac_offset + c); // 0xFC06 |
| 291 | } |
| 292 | mac[0] = (uint8_t)(CUSTOM_MAC_HDR >> 8); |
| 293 | mac[1] = (uint8_t)CUSTOM_MAC_HDR; |
| 294 | |
| 295 | mac[6] = (uint8_t)(mac_suffix >> 8); |
| 296 | mac[7] = (uint8_t)(mac_suffix & 0xFF); |
| 297 | |
| 298 | uint8_t xorchk = 0; |
| 299 | for (uint8_t c = 2; c < 8; c++) { |
| 300 | xorchk ^= (mac[c] & 0x0F); |
| 301 | xorchk ^= (mac[c] >> 4); |
| 302 | } |
| 303 | mac[7] |= xorchk; |
| 304 | } |
| 305 | |
| 306 | // extract original mac from segmented tag |
| 307 | void flasher::get_mac_format2() { |
nothing calls this directly
no test coverage detected