fix(simu): simulator shutdown (#6196)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
Raphael Coeffic
2025-05-06 13:57:46 +10:00
committed by GitHub
co-authored by philmoz
parent 36172d7f44
commit a3e1f1c021
11 changed files with 118 additions and 56 deletions
+2 -8
View File
@@ -48,7 +48,6 @@ static mutex_handle_t mixerMutex;
// mixerTaskStart() has been called.
static bool _mixer_started = false;
static bool _mixer_running = false;
static bool _mixer_exit = false;
void mixerTaskLock()
{
@@ -93,14 +92,9 @@ void mixerTaskStop()
mixerTaskUnlock();
}
void mixerTaskExit()
{
_mixer_exit = true;
}
bool mixerTaskRunning()
{
return _mixer_running && !_mixer_exit;
return _mixer_running;
}
volatile uint16_t timeForcePowerOffPressed = 0;
@@ -144,7 +138,7 @@ void mixerTask()
gyroInit();
#endif
while (!_mixer_exit) {
while (task_running()) {
int timeout = 0;
for (; timeout < MIXER_MAX_PERIOD; timeout += MIXER_FREQUENT_ACTIONS_PERIOD) {
-9
View File
@@ -53,15 +53,6 @@ void mixerTaskStart();
//
void mixerTaskStop();
// exit the mixer forever.
//
// This is probably only useful for simulations as it is not needed to really
// exit the task under any normal conditions. There are no guarantees as to when
// the exit will happen, only that it will eventually happen.
//
void mixerTaskExit();
// hint at whether or not the mixer task should be running
//
// Please note: there is no guarantee on anything, this is just returning