GDI red FATAL led on cranking fix #3766
This commit is contained in:
parent
c628d72ff8
commit
f34d968a20
|
@ -302,9 +302,6 @@ void Engine::updateSlowSensors() {
|
||||||
vBattForTle8888 = Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE);
|
vBattForTle8888 = Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE);
|
||||||
#endif /* BOARD_TLE8888_COUNT */
|
#endif /* BOARD_TLE8888_COUNT */
|
||||||
|
|
||||||
#if EFI_MC33816
|
|
||||||
initMc33816IfNeeded();
|
|
||||||
#endif // EFI_MC33816
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ static void showStats() {
|
||||||
efiPrintf("MC driver status 0x%x", mcDriverStatus);
|
efiPrintf("MC driver status 0x%x", mcDriverStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void initMc33816IfNeeded();
|
||||||
static void mcRestart();
|
static void mcRestart();
|
||||||
|
|
||||||
|
|
||||||
|
@ -420,8 +421,6 @@ static void download_register(int r_target) {
|
||||||
spiUnselect(driver);
|
spiUnselect(driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool haveMc33816 = false;
|
|
||||||
|
|
||||||
void initMc33816() {
|
void initMc33816() {
|
||||||
//
|
//
|
||||||
// see setTest33816EngineConfiguration for default configuration
|
// see setTest33816EngineConfiguration for default configuration
|
||||||
|
@ -461,8 +460,7 @@ void initMc33816() {
|
||||||
addConsoleAction("mc33_restart", mcRestart);
|
addConsoleAction("mc33_restart", mcRestart);
|
||||||
//addConsoleActionI("mc33_send", sendWord);
|
//addConsoleActionI("mc33_send", sendWord);
|
||||||
|
|
||||||
haveMc33816 = true;
|
initMc33816IfNeeded();
|
||||||
mcRestart();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mcShutdown() {
|
static void mcShutdown() {
|
||||||
|
@ -571,14 +569,13 @@ static void mcRestart() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void initMc33816IfNeeded() {
|
static void initMc33816IfNeeded() {
|
||||||
if (!haveMc33816) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) < LOW_VBATT) {
|
if (Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) < LOW_VBATT) {
|
||||||
isInitializaed = false;
|
isInitializaed = false;
|
||||||
} else {
|
} else {
|
||||||
if (!isInitializaed) {
|
if (!isInitializaed) {
|
||||||
|
// WARNING: 'mcRestart' current implementation works in non-irq user content only
|
||||||
|
// note all the locking SPI API usage
|
||||||
mcRestart();
|
mcRestart();
|
||||||
isInitializaed = true;
|
isInitializaed = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,3 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
void initMc33816();
|
void initMc33816();
|
||||||
void initMc33816IfNeeded();
|
|
||||||
|
|
Loading…
Reference in New Issue