mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Merge pull request #3916 from opentx/3djc/revise-sdcard-version
3djc/revise sdcard version
This commit is contained in:
commit
eb24bbacbb
13 changed files with 21 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -931,7 +931,7 @@
|
|||
#define TR_ALARMSWARN "ALARMU"
|
||||
#define TR_SWITCHWARN "POZICE"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_WRONG_SDCARDVERSION "Chybná verze souborů na kartě"
|
||||
#define TR_WRONG_SDCARDVERSION "Doporučená ver.: "
|
||||
#define TR_WRONG_PCBREV "Jiná verze PCB/firmware"
|
||||
#define TR_EMERGENCY_MODE "NOUZOVÝ REŽIM"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Version requise : "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Verkeerde PCB gedetecteerd"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB fout"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -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 "Expected version: "
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
#define TR_PCBREV_ERROR "PCB error"
|
||||
|
|
|
@ -7,8 +7,10 @@ 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
|
||||
sdcard_version="2.2V"+$(grep 'set(SDCARD_VERSION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g')
|
||||
echo $sdcard_version > ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version
|
||||
echo $sdcard_version > ${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
|
||||
|
@ -41,6 +43,8 @@ else
|
|||
rm -f ${output}/sdcard/*.zip
|
||||
cd ${workdir}/sdcard/taranis && zip -r ${output}/sdcard/sdcard-taranis.zip *
|
||||
cd ${workdir}/sdcard/horus && zip -r ${output}/sdcard/sdcard-horus.zip *
|
||||
mv ${output}/sdcard/sdcard-horus.zip ${output}/sdcard/sdcard-horus-$sdcard_version.zip
|
||||
mv ${output}/sdcard/sdcard-taranis.zip ${output}/sdcard/sdcard-taranis-$sdcard_version.zip
|
||||
rm -Rf ${workdir}/sdcard
|
||||
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue