only setup etb if primary sensor configured instead of proxy (#1489)
* only setup etb if primary sensor configured instead of proxy * fix test Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
6d8f765b56
commit
65625deb32
|
@ -736,7 +736,7 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
// If you don't have a pedal, we have no business here.
|
||||
if (!Sensor::hasSensor(SensorType::AcceleratorPedal)) {
|
||||
if (!Sensor::hasSensor(SensorType::AcceleratorPedalPrimary)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ TEST(etb, initializationSingleThrottle) {
|
|||
|
||||
// Must have a sensor configured before init
|
||||
Sensor::setMockValue(SensorType::AcceleratorPedal, 0);
|
||||
Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 0);
|
||||
|
||||
// Expect mock0 to be init with index 0, and PID params
|
||||
EXPECT_CALL(mocks[0], init(_, 0, &engineConfiguration->etb, Ne(nullptr)));
|
||||
|
@ -65,6 +66,7 @@ TEST(etb, initializationDualThrottle) {
|
|||
|
||||
// Must have a sensor configured before init
|
||||
Sensor::setMockValue(SensorType::AcceleratorPedal, 0);
|
||||
Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 0);
|
||||
|
||||
// The presence of a second TPS indicates dual throttle
|
||||
Sensor::setMockValue(SensorType::Tps2, 25.0f);
|
||||
|
|
Loading…
Reference in New Issue