migrating to SensorType::Rpm API

This commit is contained in:
Andrey 2022-01-20 22:51:20 -05:00
parent 5ea408c033
commit e945bc4bc9
2 changed files with 4 additions and 4 deletions

View File

@ -292,7 +292,7 @@ float IdleController::getIdlePosition() {
if (useInstantRpmForIdle) {
rpm = engine->triggerCentral.triggerState.getInstantRpm();
} else {
rpm = GET_RPM();
rpm = Sensor::getOrZero(SensorType::Rpm);
}
// Compute the target we're shooting for

View File

@ -370,7 +370,7 @@ TEST(idle_v2, IntegrationManual) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value);
Sensor::setMockValue(SensorType::Clt, expectedClt);
Sensor::setMockValue(SensorType::VehicleSpeed, 15.0);
engine->rpmCalculator.mockRpm = 950;
Sensor::setMockValue(SensorType::Rpm, 950);
// Target of 1000 rpm
EXPECT_CALL(dut, getTargetRpm(expectedClt))
@ -404,7 +404,7 @@ TEST(idle_v2, IntegrationAutomatic) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value);
Sensor::setMockValue(SensorType::Clt, expectedClt);
Sensor::setMockValue(SensorType::VehicleSpeed, 15.0);
engine->rpmCalculator.mockRpm = 950;
Sensor::setMockValue(SensorType::Rpm, 950);
// Target of 1000 rpm
EXPECT_CALL(dut, getTargetRpm(expectedClt))
@ -441,7 +441,7 @@ TEST(idle_v2, IntegrationClamping) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value);
Sensor::setMockValue(SensorType::Clt, expectedClt);
Sensor::setMockValue(SensorType::VehicleSpeed, 15.0);
engine->rpmCalculator.mockRpm = 950;
Sensor::setMockValue(SensorType::Rpm, 950);
// Target of 1000 rpm
EXPECT_CALL(dut, getTargetRpm(expectedClt))