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

Function modInstallMods

xs/platforms/nrf52/xsHost.c:569–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567}
568
569void *modInstallMods(xsMachine *the, void *preparationIn, uint8_t *status)
570{
571 txPreparation *preparation = preparationIn;
572 void *result = NULL;
573
574 if (NULL == gFlashMutex)
575 gFlashMutex = xSemaphoreCreateMutex();
576
577 if (fxMapArchive(the, preparation, (void *)kModulesStart, kFlashSectorSize, spiRead, spiWrite)) {
578 result = (void *)kModulesStart;
579 fxSetArchive(the, result);
580 }
581
582 if (XS_ATOM_ERROR == c_read32be((void *)(4 + kModulesStart))) {
583 *status = *(8 + (uint8_t *)kModulesStart);
584 modLog("mod failed");
585 }
586 else
587 *status = 0;
588
589 return result;
590}
591
592#endif /* MODDEF_XS_MODS */
593

Callers

nothing calls this directly

Calls 2

fxMapArchiveFunction · 0.85
fxSetArchiveFunction · 0.85

Tested by

no test coverage detected