MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / writeInfoBlock

Method writeInfoBlock

ESP32_AP-Flasher/src/flasher.cpp:381–401  ·  view source on GitHub ↗

write info to infoblock

Source from the content-addressed store, hash-verified

379
380// write info to infoblock
381bool flasher::writeInfoBlock() {
382 if (infoblock == nullptr) return false;
383 if (!zbs->select_flash(1)) return false;
384 zbs->erase_infoblock();
385 if (!zbs->select_flash(1)) return false;
386 // select info page
387
388 for (uint16_t c = 0; c < 1024; c++) {
389 if (infoblock[c] == 0xFF) goto ifBlockWriteSuccess;
390 for (uint8_t i = 0; i < MAX_WRITE_ATTEMPTS; i++) {
391 zbs->write_flash(c, infoblock[c]);
392 if (zbs->read_flash(c) == infoblock[c]) {
393 goto ifBlockWriteSuccess;
394 }
395 }
396 return false;
397 ifBlockWriteSuccess:
398 continue;
399 }
400 return true;
401}
402
403bool flasher::prepareInfoBlock() {
404 if (infoblock == nullptr) return false;

Callers 6

doForcedAPFlashFunction · 0.45
doAPFlashFunction · 0.45
doAPUpdateFunction · 0.45
doTagFlashFunction · 0.45
autoFlashFunction · 0.45
webFlasherTaskFunction · 0.45

Calls 4

select_flashMethod · 0.45
erase_infoblockMethod · 0.45
write_flashMethod · 0.45
read_flashMethod · 0.45

Tested by

no test coverage detected