mmc_card: no zombie threads please

This commit is contained in:
Andrey Gusakov 2025-01-11 11:15:16 +03:00 committed by rusefillc
parent 8f45cf697f
commit 0601c4b6bf
1 changed files with 15 additions and 9 deletions

View File

@ -570,19 +570,25 @@ static THD_FUNCTION(MMCmonThread, arg) {
chThdSleepMilliseconds(300);
#endif
if (!mountMmc()) {
if (mountMmc()) {
#if EFI_TUNER_STUDIO
engine->outputChannels.sd_logging_internal = true;
#endif
if (engineConfiguration->sdTriggerLog) {
sdTriggerLogger();
} else {
mlgLogger();
}
} else {
// no card present (or mounted via USB), don't do internal logging
return;
}
#if EFI_TUNER_STUDIO
engine->outputChannels.sd_logging_internal = true;
#endif
efiPrintf("SD logger has died!");
if (engineConfiguration->sdTriggerLog) {
sdTriggerLogger();
} else {
mlgLogger();
// exiting thread will create zombie!
while(1) {
chThdSleepMilliseconds(100);
}
}