mirror of https://github.com/rusefi/rusefi.git
enginePins.o2heater technical debt or confusion #5727
This commit is contained in:
parent
7608699a2d
commit
c6b2a014c3
|
@ -154,7 +154,8 @@ void Engine::periodicSlowCallback() {
|
|||
|
||||
updateVrThresholdPwm();
|
||||
|
||||
enginePins.o2heater.setValue(engineConfiguration->forceO2Heating || engine->rpmCalculator.isRunning());
|
||||
getEngineState()->heaterControlEnabled = engineConfiguration->forceO2Heating || engine->rpmCalculator.isRunning();
|
||||
enginePins.o2heater.setValue(getEngineState()->heaterControlEnabled);
|
||||
enginePins.starterRelayDisable.setValue(Sensor::getOrZero(SensorType::Rpm) < engineConfiguration->cranking.rpm);
|
||||
|
||||
updateGppwm();
|
||||
|
|
|
@ -142,7 +142,7 @@ void sendWidebandInfo() {
|
|||
m[0] = vbatt;
|
||||
|
||||
// Offset 1 bit 0 = heater enable
|
||||
m[1] = enginePins.o2heater.getLogicValue() ? 0x01 : 0x00;
|
||||
m[1] = engine->engineState.heaterControlEnabled ? 0x01 : 0x00;
|
||||
}
|
||||
|
||||
#endif // EFI_WIDEBAND_FIRMWARE_UPDATE && HAL_USE_CAN
|
||||
|
|
|
@ -114,6 +114,13 @@ void AemXSeriesWideband::decodeRusefiDiag(const CANRxFrame& frame) {
|
|||
// no conversion, just ohms
|
||||
esr = data->Esr;
|
||||
|
||||
// todo: suggest values 1 and 2 into the official WB source fault enum?
|
||||
#define HACK_CRANKING_VALUE 2
|
||||
|
||||
if (!engine->engineState.heaterControlEnabled) {
|
||||
faultCode = HACK_CRANKING_VALUE;
|
||||
return;
|
||||
}
|
||||
faultCode = static_cast<uint8_t>(data->Status);
|
||||
|
||||
if (data->Status != wbo::Fault::None) {
|
||||
|
|
Loading…
Reference in New Issue