[simu] Refactor simu startup and shutdown handling (for 2.3 branch):
* Use pwrCheck() as primary control point for shutdown, centralizes thread control in simpgmspace module; * Remove main_thread_running in favor of separate variables for startup mode and shutdown flag; * Don't start a thread for ARM startup, just run simuMain() directly (the thread just exits anyway); * Refactor SIMU_SLEEP() macro, and remove all unnecessary uses of it, also remove SIMU_SLEEP_NORET; * Add startType param to opentxStart() to control splash and startup checks; * Fixes backlight never turning off in simulator with "SWITCH" power button type (pwrPressed() was always true); * Fixes simu shutdown when model checklist is displayed at startup; * Adds stubs to possibly simulate a "soft" power button in the future.
This commit is contained in:
@@ -82,6 +82,7 @@ void runFatalErrorScreen(const char * message)
|
||||
uint32_t pwr_check = pwrCheck();
|
||||
if (pwr_check == e_power_off) {
|
||||
boardOff();
|
||||
return; // only happens in SIMU, required for proper shutdown
|
||||
}
|
||||
else if (pwr_check == e_power_press) {
|
||||
refresh = true;
|
||||
@@ -89,7 +90,6 @@ void runFatalErrorScreen(const char * message)
|
||||
else if (pwr_check == e_power_on && refresh) {
|
||||
break;
|
||||
}
|
||||
SIMU_SLEEP_NORET(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user