| 567 | } |
| 568 | |
| 569 | void *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 |
nothing calls this directly
no test coverage detected