MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / performUpdate

Function performUpdate

src/sd_functions.cpp:417–443  ·  view source on GitHub ↗

** Function name: performUpdate ** Description: this function performs the update ***************************************************************************************/

Source from the content-addressed store, hash-verified

415** Description: this function performs the update
416***************************************************************************************/
417bool performUpdate(Stream &updateSource, size_t updateSize, int command) {
418 bool success = false;
419 tft->fillRoundRect(6, 6, tftWidth - 12, tftHeight - 12, 5, BGCOLOR);
420 progressHandler(0, 500);
421
422 pauseSdInstallInput();
423 LauncherUpdateTarget target;
424 if (launcherUpdateTargetFromCommand(command, target)) {
425 prog_handler = target == LAUNCHER_UPDATE_APP ? 0 : 1;
426 log_i("updateSize = %d", updateSize);
427 if (launcherUpdateStream(updateSource, updateSize, target, progressHandler) &&
428 launcherUpdateIsFinished()) {
429 log_i("Update successfully completed. Rebooting.");
430 displayRedStripe("Post Install Cleanup");
431 launcherClearCoredump();
432 success = true;
433 } else {
434 log_i("Error Occurred. Error #: %d", launcherUpdateLastError());
435 }
436 } else {
437 uint8_t error = launcherUpdateLastError();
438 displayRedStripe("E:" + String(error) + "-Wrong Partition Scheme");
439 launcherDelayMs(2500);
440 }
441 resumeSdInstallInput();
442 return success;
443}
444static String installedAppNameFromPath(const String &path) { return launcherAppNameFromFile(path); }
445
446static bool flashRawFromSd(

Callers

nothing calls this directly

Calls 11

progressHandlerFunction · 0.85
pauseSdInstallInputFunction · 0.85
launcherUpdateStreamFunction · 0.85
launcherUpdateIsFinishedFunction · 0.85
displayRedStripeFunction · 0.85
launcherClearCoredumpFunction · 0.85
launcherUpdateLastErrorFunction · 0.85
launcherDelayMsFunction · 0.85
resumeSdInstallInputFunction · 0.85
fillRoundRectMethod · 0.45

Tested by

no test coverage detected