Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(color): unable to turn off radio if powered on with no SD card. #5893

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions radio/src/edgetx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,15 @@ void edgeTxInit()
{
TRACE("edgeTxInit");

#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

// Show splash screen (color LCD)
if (!(startOptions & OPENTX_START_NO_SPLASH))
startSplash();
Expand Down Expand Up @@ -1623,15 +1632,6 @@ int main()
}
#endif

#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

tasksStart();
}

Expand Down
7 changes: 7 additions & 0 deletions radio/src/gui/colorlcd/startup_shutdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ void runFatalErrorScreen(const char* message)
{
lcdInitDisplayDriver();

drawFatalErrorScreen(message);

// On startup wait for power button to be released
while (pwrPressed()) {
WDG_RESET();
}

while (true) {
drawFatalErrorScreen(message);
WDG_RESET();
Expand Down