Bsongis/autoupdate (#6521)

Auto update internal chips at boot if /FIRMWARE/autoupdate.frsk is present on SD
This commit is contained in:
Bertrand Songis
2019-06-21 08:52:48 +02:00
committed by GitHub
parent 8cdcf565c2
commit dbec79e10f
10 changed files with 99 additions and 21 deletions
+11 -1
View File
@@ -18,6 +18,7 @@
* GNU General Public License for more details.
*/
#include <io/frsky_firmware_update.h>
#include "opentx.h"
RadioData g_eeGeneral;
@@ -1753,10 +1754,19 @@ void opentxInit()
unexpectedShutdown = 1;
}
#if defined(SDCARD) && !defined(PCBMEGA2560)
#if defined(SDCARD)
// SDCARD related stuff, only done if not unexpectedShutdown
if (!unexpectedShutdown) {
sdInit();
#if defined(AUTOUPDATE)
if (f_stat(AUTOUPDATE_FILENAME, nullptr) == FR_OK) {
FrskyChipFirmwareUpdate device;
if (device.flashFirmware(AUTOUPDATE_FILENAME, false) == nullptr)
f_unlink(AUTOUPDATE_FILENAME);
}
#endif
logsInit();
}
#endif