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

Function modInstallMods

xs/platforms/pebble/xsHost.c:283–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283void *modInstallMods(xsMachine *the, void *preparationIn, uint8_t *status)
284{
285 txPreparation *preparation = preparationIn;
286 void *result = NULL;
287
288 if (NULL == gFlashMutex)
289 gFlashMutex = xSemaphoreCreateMutex();
290
291 if (fxMapArchive(the, preparation, (void *)kModulesStart, kFlashSectorSize, spiRead, spiWrite)) {
292 result = (void *)kModulesStart;
293 fxSetArchive(the, result);
294 }
295
296 if (XS_ATOM_ERROR == c_read32be((void *)(4 + kModulesStart))) {
297 *status = *(8 + (uint8_t *)kModulesStart);
298 modLog("mod failed");
299 }
300 else
301 *status = 0;
302
303 return result;
304}
305
306#endif /* MODDEF_XS_MODS */
307

Callers

nothing calls this directly

Calls 2

fxMapArchiveFunction · 0.85
fxSetArchiveFunction · 0.85

Tested by

no test coverage detected