only: fansDisabledByBoardStatus

This commit is contained in:
rusefillc 2024-03-24 13:28:56 -04:00
parent 5642d412de
commit a690fc3ab5
2 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,10 @@ bool boardEnableSendWidebandInfo() {
return megaEn.getLogicValue();
}
bool fansDisabledByBoardStatus() {
return !megaEn.getLogicValue();
}
void hellenEnableEn() {
megaEn.setValue(1);
}

View File

@ -4,6 +4,10 @@
#include "bench_test.h"
__attribute__((weak)) bool fansDisabledByBoardStatus() {
return false;
}
bool FanController::getState(bool acActive, bool lastState) {
auto clt = Sensor::get(SensorType::Clt);
auto vss = Sensor::get(SensorType::VehicleSpeed);
@ -32,6 +36,8 @@ bool FanController::getState(bool acActive, bool lastState) {
} else if (disabledBySpeed) {
// Inhibit while driving fast
return false;
} else if (fansDisabledByBoardStatus()) {
return false;
} else if (brokenClt) {
// If CLT is broken, turn the fan on
return true;