| 479 | } |
| 480 | |
| 481 | bool flasher::readBlock(uint16_t offset, uint8_t *data, uint16_t len, bool infopage) { |
| 482 | if (infopage) { |
| 483 | if (!zbs->select_flash(1)) return false; |
| 484 | if (offset > 1024) return false; |
| 485 | } else { |
| 486 | if (!zbs->select_flash(0)) return false; |
| 487 | if (offset > 65535) return false; |
| 488 | } |
| 489 | for (uint32_t c = 0; c < len; c++) { |
| 490 | data[c] = zbs->read_flash(offset + c); |
| 491 | } |
| 492 | return true; |
| 493 | } |
| 494 | |
| 495 | bool flasher::writeBlock(uint16_t offset, uint8_t *data, uint16_t len, bool infopage) { |
| 496 | if (infopage) { |
no test coverage detected