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

Function modInstallMods

xs/platforms/zephyr/xsHost.c:412–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412void *modInstallMods(xsMachine *the, void *preparationIn, uint8_t *status)
413{
414 if (!modSPIFlashInit() || (0 == gModFlashBlockSize))
415 return 0;
416
417 txPreparation *preparation = preparationIn;
418 void *result = NULL;
419 if (fxMapArchive(the, preparation, (void *)kModulesStart, gModFlashBlockSize, spiRead, spiWrite)) {
420 result = (void *)kModulesStart;
421 fxSetArchive(the, result);
422 }
423
424 if (XS_ATOM_ERROR == c_read32be((void *)(4 + kModulesStart)))
425 *status = *(8 + (uint8_t *)kModulesStart);
426 else
427 *status = 0;
428
429 return result;
430}
431
432/*
433 flash

Callers

nothing calls this directly

Calls 3

fxMapArchiveFunction · 0.85
fxSetArchiveFunction · 0.85
modSPIFlashInitFunction · 0.70

Tested by

no test coverage detected