only: power management for SD card MSD

This commit is contained in:
rusefillc 2024-04-13 12:11:19 -04:00
parent 21e22cb7da
commit 4ddb23cda9
1 changed files with 6 additions and 0 deletions

View File

@ -533,6 +533,12 @@ static THD_FUNCTION(MMCmonThread, arg) {
while (!getHellenBoardEnabled()) {
// wait until board enables peripheral
chThdSleepMilliseconds(100);
if (getTimeNowS() > 4 && !isIgnVoltage()) {
// looks like vehicle is OFF and we are hooked to USB - turn on peripheral to get Mass Storage Device USB profile
efiPrintf(" *** turning board ON to power SD card ***");
hellenEnableEn();
break;
}
}
chThdSleepMilliseconds(300);
#endif