| 552 | } |
| 553 | |
| 554 | static txBoolean spiWrite(void *dst, size_t offset, void *buffer, size_t size) |
| 555 | { |
| 556 | offset += (uintptr_t)dst; |
| 557 | |
| 558 | if ((offset + kFlashSectorSize) > (uintptr_t)kModulesEnd) |
| 559 | return 0; // attempted write beyond end of available space |
| 560 | |
| 561 | if (!(offset & (kFlashSectorSize - 1))) { // if offset is at start of a sector, erase that sector |
| 562 | if (!modSPIErase(offset - (uintptr_t)kFlashStart, kFlashSectorSize)) |
| 563 | return 0; |
| 564 | } |
| 565 | |
| 566 | return modSPIWrite(offset - (uintptr_t)kFlashStart, size, buffer); |
| 567 | } |
| 568 | |
| 569 | void *modInstallMods(xsMachine *the, void *preparationIn, uint8_t *status) |
| 570 | { |
nothing calls this directly
no test coverage detected