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

Function modInstallMods

xs/platforms/esp/xsHost.c:1385–1406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1383}
1384
1385void *modInstallMods(xsMachine *the, void *preparationIn, uint8_t *status)
1386{
1387 txPreparation *preparation = preparationIn;
1388 void *result = NULL;
1389
1390 if (!gPartitionAddress)
1391 return NULL;
1392
1393 if (fxMapArchive(the, preparation, (void *)gPartition, kFlashSectorSize, spiRead, spiWrite)) {
1394 result = (void *)gPartitionAddress;
1395 fxSetArchive(the, result);
1396 }
1397
1398 if (XS_ATOM_ERROR == c_read32be(4 + kModulesStart)) {
1399 *status = *(8 + (uint8_t *)kModulesStart);
1400 modLog("mod failed");
1401 }
1402 else
1403 *status = 0;
1404
1405 return result;
1406}
1407
1408#else /* ESP8266 */
1409

Callers 1

modCloneMachineFunction · 0.50

Calls 2

fxMapArchiveFunction · 0.85
fxSetArchiveFunction · 0.85

Tested by

no test coverage detected