migrating to SensorType::Rpm API
This commit is contained in:
parent
df5cb34fb8
commit
e55eb28086
|
@ -291,7 +291,7 @@ void Engine::updateSlowSensors() {
|
|||
updateSwitchInputs();
|
||||
|
||||
#if EFI_ENGINE_CONTROL
|
||||
int rpm = GET_RPM();
|
||||
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
isEngineChartEnabled = engineConfiguration->isEngineChartEnabled && rpm < engineConfiguration->engineSnifferRpmThreshold;
|
||||
sensorChartMode = rpm < engineConfiguration->sensorSnifferRpmThreshold ? engineConfiguration->sensorChartMode : SC_OFF;
|
||||
|
||||
|
@ -441,7 +441,7 @@ void Engine::OnTriggerSynchronizationLost() {
|
|||
|
||||
void Engine::OnTriggerInvalidIndex(int currentIndex) {
|
||||
// let's not show a warning if we are just starting to spin
|
||||
if (GET_RPM() != 0) {
|
||||
if (Sensor::getOrZero(SensorType::Rpm) != 0) {
|
||||
warning(CUSTOM_SYNC_ERROR, "sync error: index #%d above total size %d", currentIndex, triggerCentral.triggerShape.getSize());
|
||||
triggerCentral.triggerState.setTriggerErrorState();
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ void StartupFuelPumping::setPumpsCounter(int newValue) {
|
|||
}
|
||||
|
||||
void StartupFuelPumping::update() {
|
||||
if (GET_RPM() == 0) {
|
||||
if (Sensor::getOrZero(SensorType::Rpm) == 0) {
|
||||
bool isTpsAbove50 = Sensor::getOrZero(SensorType::DriverThrottleIntent) >= 50;
|
||||
|
||||
if (this->isTpsAbove50 != isTpsAbove50) {
|
||||
|
|
|
@ -251,7 +251,7 @@ TEST(misc, testStartupFuelPumping) {
|
|||
|
||||
StartupFuelPumping sf;
|
||||
|
||||
engine->rpmCalculator.mockRpm = 0;
|
||||
Sensor::setMockValue(SensorType::Rpm, 0);
|
||||
|
||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 60);
|
||||
sf.update();
|
||||
|
@ -264,12 +264,12 @@ TEST(misc, testStartupFuelPumping) {
|
|||
sf.update();
|
||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pc#3";
|
||||
|
||||
engine->rpmCalculator.mockRpm = 10;
|
||||
Sensor::setMockValue(SensorType::Rpm, 10);
|
||||
sf.update();
|
||||
ASSERT_EQ( 0, sf.pumpsCounter) << "pc#4";
|
||||
|
||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 70);
|
||||
engine->rpmCalculator.mockRpm = 0;
|
||||
Sensor::setMockValue(SensorType::Rpm, 0);
|
||||
sf.update();
|
||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pc#5";
|
||||
|
||||
|
|
Loading…
Reference in New Issue