bool CheckForUpdates() { ERROR_OUTPUT(__func__); int nu = NeedUpdate(); if (nu != UPDATE_NONE) { if (nu == UPDATE_MCF) { ERROR_OUTPUT("Updating from MCF."); int ret = McfUpdate(); // desura_update.mcf if (FileExists(UPDATEFILE)) DeleteFile(UPDATEFILE); if(ret != ERR_USERCANCELED) RestartBootloader(); return false; } else { ERROR_OUTPUT("Doing FULL update."); int ret = FullUpdate(); // desura_update.mcf if (FileExists(UPDATEFILE)) DeleteFile(UPDATEFILE); if(ret != ERR_USERCANCELED) // if they didn't cancel RestartBootloader(); return false; } } else { ERROR_OUTPUT("Not doing update."); } return false; }
/* Reset the device and stay in the bootloader when it restarts. * Syntax: r * Response: none (will see startup message after reset) */ static void RestartBootloader_CMD(const char *cmdbuf, uint8_t len) { RestartBootloader(); }