| 410 | } |
| 411 | |
| 412 | void *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 |
nothing calls this directly
no test coverage detected