Add a "No SD card" screen on boot (#1451)

This prevents certain issues related to SD card being now mandatory to run EdgeTx.
This commit is contained in:
Raphael Coeffic
2022-01-21 20:18:27 +10:00
committed by GitHub
parent e07695f1e9
commit 4048983ce5
3 changed files with 47 additions and 4 deletions
+11 -4
View File
@@ -1824,6 +1824,13 @@ void opentxInit()
if (!sdMounted())
sdInit();
#if !defined(COLORLCD)
if (!sdMounted()) {
g_eeGeneral.pwrOffSpeed = 2;
runFatalErrorScreen(STR_NO_SDCARD);
}
#endif
#if defined(AUTOUPDATE)
sportStopSendByteLoop();
if (f_stat(AUTOUPDATE_FILENAME, nullptr) == FR_OK) {
@@ -2005,12 +2012,12 @@ int main()
}
#endif
#if !defined(EEPROM)
if (!SD_CARD_PRESENT() && !UNEXPECTED_SHUTDOWN()) {
// TODO: b/w SD card fatal screen
#if defined(COLORLCD)
// SD_CARD_PRESENT() does not work properly on most
// B&W targets, so that we need to delay the detection
// until the SD card is mounted (requires RTOS scheduler running)
if (!SD_CARD_PRESENT() && !UNEXPECTED_SHUTDOWN()) {
runFatalErrorScreen(STR_NO_SDCARD);
#endif
}
#endif