3djc/sdcard version check (#3709)
* Checking code * Strings * Fix * Improvement * Cosmetics
This commit is contained in:
@@ -1084,6 +1084,27 @@ void doSplash()
|
||||
#define doSplash()
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
void checkSDVersion()
|
||||
{
|
||||
if (sdMounted()) {
|
||||
FIL versionFile = {0};
|
||||
UINT read = 0;
|
||||
char version[sizeof(REQUIRED_SDCARD_VERSION)];
|
||||
|
||||
FRESULT result = f_open(&versionFile, "/opentx.sdcard.version", FA_OPEN_EXISTING | FA_READ);
|
||||
if ((result == FR_OK) && (f_size(&versionFile) == sizeof(REQUIRED_SDCARD_VERSION))) {
|
||||
f_read(&versionFile, &version, sizeof(REQUIRED_SDCARD_VERSION), &read);
|
||||
}
|
||||
f_close(&versionFile);
|
||||
if (strncmp(version, REQUIRED_SDCARD_VERSION, sizeof(REQUIRED_SDCARD_VERSION)-1) != 0) {
|
||||
TRACE("sdCheckVersion FAILED");
|
||||
ALERT(STR_SDCARDVERSIONWARN, STR_WRONG_SDCARDVERSION, AU_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void checkFailsafe()
|
||||
{
|
||||
@@ -1118,6 +1139,10 @@ void checkAll()
|
||||
checkFailsafe();
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
checkSDVersion();
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
if (g_model.displayChecklist && modelHasNotes()) {
|
||||
pushModelNotes();
|
||||
|
||||
Reference in New Issue
Block a user