Clean-up analog channels in "unit" tests #1456

This commit is contained in:
rusefi 2020-05-20 03:54:40 -04:00
parent f2cf1358c1
commit 3ffc51f495
2 changed files with 3 additions and 10 deletions

View File

@ -8,17 +8,9 @@
#include "boards.h"
#include "engine.h"
// todo: migrate to engine->engineState.mockAdcState
float testMafValue = 0;
// see setMockVoltage
float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) {
switch(hwChannel) {
case TEST_MAF_CHANNEL:
return testMafValue;
default:
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));;
}
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));;
}
float getVoltage(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) {

View File

@ -57,7 +57,8 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
commonInitEngineController(NULL PASS_ENGINE_PARAMETER_SUFFIX);
engine->engineConfigurationPtr->mafAdcChannel = TEST_MAF_CHANNEL;
engineConfiguration->mafAdcChannel = EFI_ADC_10;
engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0 PASS_ENGINE_PARAMETER_SUFFIX);
Sensor::setMockValue(SensorType::Clt, 70);
Sensor::setMockValue(SensorType::Iat, 30);