Radiator Fans not engaging, all settings seem correct? 20240405 RevC #140

only:hellen154hyundai
This commit is contained in:
Andrey 2024-04-12 12:50:31 -04:00
parent 61407ff012
commit 4b5a9c8aa2
2 changed files with 13 additions and 0 deletions

View File

@ -29,27 +29,36 @@ bool FanController::getState(bool acActive, bool lastState) {
if (cranking) {
// Inhibit while cranking
tempCode = 31;
return false;
} else if (disabledWhileEngineStopped) {
// Inhibit while not running (if so configured)
tempCode = 32;
return false;
} else if (disabledBySpeed) {
// Inhibit while driving fast
tempCode = 33;
return false;
} else if (fansDisabledByBoardStatus()) {
tempCode = 34;
return false;
} else if (brokenClt) {
// If CLT is broken, turn the fan on
tempCode = 35;
return true;
} else if (enabledForAc) {
tempCode = 36;
return true;
} else if (hot) {
// If hot, turn the fan on
tempCode = 37;
return true;
} else if (cold) {
// If cold, turn the fan off
tempCode = 38;
return false;
} else {
tempCode = 40;
// no condition met, maintain previous state
return lastState;
}
@ -58,6 +67,7 @@ bool FanController::getState(bool acActive, bool lastState) {
void FanController::onSlowCallback() {
#if EFI_PROD_CODE
if (isRunningBenchTest()) {
tempCode = 30;
return; // let's not mess with bench testing
}
#endif
@ -67,6 +77,7 @@ void FanController::onSlowCallback() {
auto& pin = getPin();
bool result = getState(acActive, pin.getLogicValue());
tempAlive = tempAlive + 1;
pin.setValue(result);
}

View File

@ -7,4 +7,6 @@ struct_no_prefix fan_control_s
bit hot
bit cold
bit disabledBySpeed
uint8_t tempAlive
uint8_t tempCode
end_struct