From 2b61f674bbebf42abeb0b400739d8acc2e4166a5 Mon Sep 17 00:00:00 2001 From: 3djc Date: Sun, 16 Oct 2016 11:45:06 +0200 Subject: [PATCH] Displays required sdcard version on error --- CMakeLists.txt | 3 +-- radio/src/opentx.cpp | 6 ++++-- radio/src/translations/de.h.txt | 2 +- radio/src/translations/en.h.txt | 2 +- radio/src/translations/es.h.txt | 2 +- radio/src/translations/fi.h.txt | 2 +- radio/src/translations/fr.h.txt | 2 +- radio/src/translations/it.h.txt | 2 +- radio/src/translations/nl.h.txt | 2 +- radio/src/translations/pl.h.txt | 2 +- radio/src/translations/pt.h.txt | 2 +- radio/src/translations/se.h.txt | 2 +- tools/nightly22/build-sdcard.sh | 4 ++-- 13 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1d4e5ac7..f82485c58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,7 @@ set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR}) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX}) message(STATUS "OpenTX ${VERSION}") -set(SDCARD_REVISION "0003") -set(SDCARD_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}V${SDCARD_REVISION}) +set(SDCARD_VERSION "0003") cmake_minimum_required(VERSION 2.8) cmake_policy(SET CMP0020 NEW) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 478f8b5c1..0e8eaca4f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -988,19 +988,21 @@ void checkSDVersion() FIL versionFile = {0}; UINT read = 0; char version[sizeof(REQUIRED_SDCARD_VERSION)-1]; + char error[sizeof(TR_WRONG_SDCARDVERSION)+ sizeof(version)]; + strAppend(strAppend(error,STR_WRONG_SDCARDVERSION, sizeof(TR_WRONG_SDCARDVERSION)), REQUIRED_SDCARD_VERSION, sizeof(REQUIRED_SDCARD_VERSION)); FRESULT result = f_open(&versionFile, "/opentx.sdcard.version", FA_OPEN_EXISTING | FA_READ); if (result == FR_OK) { if (f_read(&versionFile, &version, sizeof(version), &read) != FR_OK || read != sizeof(version) || strncmp(version, REQUIRED_SDCARD_VERSION, sizeof(version)) != 0) { TRACE("SD card version mismatch: %.*s, %s", sizeof(REQUIRED_SDCARD_VERSION)-1, version, REQUIRED_SDCARD_VERSION); - ALERT(STR_SD_CARD, STR_WRONG_SDCARDVERSION, AU_ERROR); + ALERT(STR_SD_CARD, error, AU_ERROR); } f_close(&versionFile); } else { - ALERT(STR_SD_CARD, STR_WRONG_SDCARDVERSION, AU_ERROR); + ALERT(STR_SD_CARD, error, AU_ERROR); } } } diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 19a53d062..a7102587f 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -934,7 +934,7 @@ #define TR_ALARMSWARN "ALARM" #define TR_SWITCHWARN "SCHALTER" #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 275d113d6..5eccefa20 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -900,7 +900,7 @@ #define TR_ALARMSWARN "ALARMS" #define TR_SWITCHWARN TR("SWITCH", "CONTROL") #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index c227339cb..663283686 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -879,7 +879,7 @@ #define TR_ALARMSWARN "ALARMAS" #define TR_SWITCHWARN "INTERPTOR" #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 1b176109c..e1b38ee46 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -879,7 +879,7 @@ #define TR_ALARMSWARN "ALARMS" #define TR_SWITCHWARN TR("SWITCH","CONTROL") #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index ccff7aec4..f12204392 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -911,7 +911,7 @@ #define TR_ALARMSWARN "SON" #define TR_SWITCHWARN TR("INTERS","CONTROLES") #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Version des fichiers incompatible" +#define TR_WRONG_SDCARDVERSION "Requiers fichiers version : " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 2b90e3bb7..fcf21a663 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -914,7 +914,7 @@ #define TR_ALARMSWARN "ALLARMI" #define TR_SWITCHWARN "CONTROLLI" #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index 673525d17..7d16edaed 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -908,7 +908,7 @@ #define TR_ALARMSWARN "ALARM" #define TR_SWITCHWARN "SCHAKELAAR" #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Verkeerde versie van bestanden" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Verkeerde PCB gedetecteerd" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB fout" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 175543acf..bcd5ea7dd 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -916,7 +916,7 @@ #define TR_ALARMSWARN "ALARM" #define TR_SWITCHWARN TR("Przełą","Kontrola") #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index a350e3ec2..191334557 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -874,7 +874,7 @@ #define TR_ALARMSWARN "ALARMES" #define TR_SWITCHWARN "CHAVES" #define TR_FAILSAFEWARN "FAILSAFE" -#define TR_WRONG_SDCARDVERSION "Wrong files version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 6266b7c93..975d1fd02 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -928,7 +928,7 @@ #define TR_SWITCHWARN "BRYTARE" #define TR_FAILSAFEWARN "FAILSAFE" #define TR_SDCARDVERSIONWARN "SD Card Check" -#define TR_WRONG_SDCARDVERSION "Wrong SDCARD file version" +#define TR_WRONG_SDCARDVERSION "Needed file version: " #define TR_WRONG_PCBREV "Wrong PCB detected" #define TR_EMERGENCY_MODE "EMERGENCY MODE" #define TR_PCBREV_ERROR "PCB error" diff --git a/tools/nightly22/build-sdcard.sh b/tools/nightly22/build-sdcard.sh index 80d985cab..25f010960 100755 --- a/tools/nightly22/build-sdcard.sh +++ b/tools/nightly22/build-sdcard.sh @@ -7,8 +7,8 @@ workdir=/home/opentx/nightly22 output=/var/www/html/2.2/nightly # Handle opentx.sdcard.version -grep 'set(SDCARD_REVISION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g' > ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version -grep 'set(SDCARD_REVISION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g' > ${workdir}/code/radio/sdcard/taranis/opentx.sdcard.version +grep 'set(SDCARD_VERSION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g' > ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version +grep 'set(SDCARD_VERSION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g' > ${workdir}/code/radio/sdcard/taranis/opentx.sdcard.version if cmp --silent ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version ${workdir}/opentx.sdcard.version then exit