1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

[Horus] SD hot mount if removed when the radio is ON

This commit is contained in:
Bertrand Songis 2016-08-31 23:06:02 +02:00
parent 90e8748e12
commit 830593d62e
14 changed files with 27 additions and 7 deletions

View file

@ -413,19 +413,26 @@ void perMain()
#if defined(RAMBACKUP)
if (unexpectedShutdown) {
lcd->clear();
lcdDrawText(LCD_W/2, LCD_H/2-20, "EMERGENCY MODE", DBLSIZE|CENTERED|TEXT_BGCOLOR);
lcdRefresh();
drawFatalErrorScreen(STR_EMERGENCY_MODE);
return;
}
#endif
#if defined(PCBHORUS)
// TODO if it is OK on HORUS it could be ported to all other boards
// But in this case it's needed to define sdMount for all boards, because sdInit also initializes the SD mutex
static uint32_t sdcard_present_before = SD_CARD_PRESENT();
uint32_t sdcard_present_now = SD_CARD_PRESENT();
if (sdcard_present_now && !sdcard_present_before) {
sdMount();
}
sdcard_present_before = sdcard_present_now;
#endif
#if !defined(EEPROM)
// In case the SD card is removed during the session
if (!SD_CARD_PRESENT()) {
lcd->clear();
lcdDrawText(LCD_W/2, LCD_H/2-20, STR_NO_SDCARD, DBLSIZE|CENTERED|TEXT_BGCOLOR);
lcdRefresh();
drawFatalErrorScreen(STR_NO_SDCARD);
return;
}
#endif

View file

@ -493,6 +493,7 @@ const pm_char STR_SWITCHWARN[] PROGMEM = TR_SWITCHWARN;
const pm_char STR_FAILSAFEWARN[] PROGMEM = TR_FAILSAFEWARN;
const pm_char STR_WRONG_SDCARDVERSION[] PROGMEM = TR_WRONG_SDCARDVERSION;
const pm_char STR_WRONG_PCBREV[] PROGMEM = TR_WRONG_PCBREV;
const pm_char STR_EMERGENCY_MODE[] PROGMEM = TR_EMERGENCY_MODE;
const pm_char STR_PCBREV_ERROR[] PROGMEM = TR_PCBREV_ERROR;
const pm_char STR_NO_FAILSAFE[] PROGMEM = TR_NO_FAILSAFE;
const pm_char STR_KEYSTUCK[] PROGMEM = TR_KEYSTUCK;

View file

@ -708,6 +708,7 @@ extern const pm_char STR_SWITCHWARN[];
extern const pm_char STR_FAILSAFEWARN[];
extern const pm_char STR_WRONG_SDCARDVERSION[];
extern const pm_char STR_WRONG_PCBREV[];
extern const pm_char STR_EMERGENCY_MODE[];
extern const pm_char STR_PCBREV_ERROR[];
extern const pm_char STR_NO_FAILSAFE[];
extern const pm_char STR_KEYSTUCK[];

View file

@ -915,6 +915,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe není nastaveno"
#define TR_KEYSTUCK "Zaseklá klávesa"

View file

@ -934,6 +934,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE TR("Failsafe not set", "Failsafe nicht programmiert")
#define TR_KEYSTUCK "Taste klemmt" //Key stuck=Taste klemmt

View file

@ -900,6 +900,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe not set"
#define TR_KEYSTUCK "Key stuck"

View file

@ -879,6 +879,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe not set"
#define TR_KEYSTUCK "Key stuck"

View file

@ -879,6 +879,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe not set"
#define TR_KEYSTUCK "Key stuck"

View file

@ -911,6 +911,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Version des fichiers incompatible"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe pas déf."
#define TR_KEYSTUCK "Touche bloquée"

View file

@ -914,6 +914,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe non settato"
#define TR_KEYSTUCK "Tasto bloccato"

View file

@ -928,6 +928,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE TR("Failsafe niet ing.", "Failsafe niet ingesteld")
#define TR_KEYSTUCK "Toets klemt"

View file

@ -916,6 +916,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Brak Failsafe"
#define TR_KEYSTUCK "Blokada klucza"

View file

@ -874,6 +874,7 @@
#define TR_FAILSAFEWARN "FAILSAFE"
#define TR_WRONG_SDCARDVERSION "Wrong files version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe not set"
#define TR_KEYSTUCK "Key stuck"

View file

@ -928,6 +928,7 @@
#define TR_SDCARDVERSIONWARN "SD Card Check"
#define TR_WRONG_SDCARDVERSION "Wrong SDCARD file version"
#define TR_WRONG_PCBREV "Wrong PCB detected"
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
#define TR_PCBREV_ERROR "PCB error"
#define TR_NO_FAILSAFE "Failsafe ej given"
#define TR_KEYSTUCK "Knapp-fel"