MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / modSPIWrite

Function modSPIWrite

xs/platforms/zephyr/xsHost.c:539–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537}
538
539uint8_t modSPIWrite(uint32_t offset, uint32_t size, const uint8_t *src)
540{
541 if (!modSPIFlashInit())
542 return 0;
543
544 size = (size + gModWriteAlign - 1) & ~(gModWriteAlign - 1); // ugly hack, but works for mods. the alternative is to make all writers aware of gModWriteAlign
545
546 if (flash_area_write(gModFlashArea, offset, src, size) < 0)
547 return 0;
548
549 return 1;
550}
551
552uint8_t modSPIErase(uint32_t offset, uint32_t size)
553{

Callers 2

spiWriteFunction · 0.70
doRemoteCommandFunction · 0.70

Calls 1

modSPIFlashInitFunction · 0.70

Tested by

no test coverage detected