ETB: we require redundancy at runtime, not at initialization time. that would allow for Lua pedal to appear later on.
only:alphax-4k-gdi
This commit is contained in:
parent
329d9cf90c
commit
4e539dfa3e
|
@ -173,15 +173,6 @@ bool EtbController::init(dc_function_e function, DcMotor *motor, pid_s *pidParam
|
|||
etbErrorCode = (int8_t)TpsState::Redundancy;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isBoardAllowingLackOfPps() && !Sensor::isRedundant(SensorType::AcceleratorPedal)) {
|
||||
firmwareError(
|
||||
ObdCode::OBD_TPS_Configuration,
|
||||
"Use of electronic throttle requires accelerator pedal to be redundant."
|
||||
);
|
||||
etbErrorCode = (int8_t)TpsState::Redundancy;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_motor = motor;
|
||||
|
@ -609,6 +600,8 @@ bool EtbController::checkStatus() {
|
|||
localReason = TpsState::Lua;
|
||||
} else if (!getLimpManager()->allowElectronicThrottle()) {
|
||||
localReason = TpsState::JamDetected;
|
||||
} else if(!isBoardAllowingLackOfPps() && !Sensor::isRedundant(SensorType::AcceleratorPedal)) {
|
||||
etbErrorCode = (int8_t)TpsState::Redundancy;
|
||||
}
|
||||
|
||||
etbErrorCode = (int8_t)localReason;
|
||||
|
|
|
@ -205,7 +205,8 @@ TEST(etb, initializationNotRedundantPedal) {
|
|||
Sensor::setMockValue(SensorType::Tps1Primary, 0);
|
||||
Sensor::setMockValue(SensorType::Tps1, 0.0f, true);
|
||||
|
||||
EXPECT_FATAL_ERROR(dut.init(DC_Throttle1, nullptr, nullptr, nullptr));
|
||||
// we require redundancy at runtime, not at initialization time. that would allow for Lua pedal to appear later on.
|
||||
ASSERT_TRUE(dut.init(DC_Throttle1, nullptr, nullptr, nullptr));
|
||||
}
|
||||
|
||||
TEST(etb, initializationNoSensor) {
|
||||
|
|
Loading…
Reference in New Issue