Merge remote-tracking branch 'origin/master'

This commit is contained in:
rusefi 2020-05-20 03:17:13 -04:00
commit 5dee5bcd6b
6 changed files with 1 additions and 26 deletions

View File

@ -185,8 +185,6 @@ typedef enum __attribute__ ((__packed__)) {
* and TunerStudio would need these ordinals to fit into field size
*/
TEST_MAF_CHANNEL = 18,
TEST_CLT_CHANNEL = 19,
TEST_IAT_CHANNEL = 20,
#endif /* EFI_UNIT_TEST */
} adc_channel_e;

View File

@ -79,8 +79,6 @@ case EFI_ADC_NONE:
return "EFI_ADC_NONE";
#if EFI_UNIT_TEST
case TEST_MAF_CHANNEL:
case TEST_CLT_CHANNEL:
case TEST_IAT_CHANNEL:
return "EFI_TEST";
#endif /* EFI_UNIT_TEST */
}

View File

@ -272,8 +272,6 @@ typedef enum __attribute__ ((__packed__)) {
* and TunerStudio would need these ordinals to fit into field size
*/
TEST_MAF_CHANNEL = 18,
TEST_CLT_CHANNEL = 19,
TEST_IAT_CHANNEL = 20,
#endif /* EFI_UNIT_TEST */
} adc_channel_e;

View File

@ -120,7 +120,6 @@ temperature_t getCoolantTemperatureM(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->useLinearCltSensor PASS_ENGINE_PARAMETER_SUFFIX);
if (!isValidCoolantTemperature(temperature)) {
efiAssert(CUSTOM_ERR_ASSERT, engineConfiguration!=NULL, "NULL engineConfiguration", NAN);
warning(OBD_Engine_Coolant_Temperature_Circuit_Malfunction, "unrealistic CLT %.2f", temperature);
engine->isCltBroken = true;
return LIMPING_MODE_CLT_TEMPERATURE;
}
@ -197,9 +196,6 @@ temperature_t getIntakeAirTemperatureM(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->useLinearIatSensor PASS_ENGINE_PARAMETER_SUFFIX);
if (!isValidIntakeAirTemperature(temperature)) {
efiAssert(CUSTOM_ERR_ASSERT, engineConfiguration!=NULL, "NULL engineConfiguration", NAN);
#if EFI_PROD_CODE || EFI_UNIT_TEST
warning(OBD_Intake_Air_Temperature_Circuit_Malfunction, "unrealistic IAT %.2f", temperature);
#endif /* EFI_PROD_CODE */
return LIMPING_MODE_IAT_TEMPERATURE;
}
return temperature;

View File

@ -10,20 +10,12 @@
// todo: migrate to engine->engineState.mockAdcState
float testMafValue = 0;
float testCltValue = 0;
float testIatValue = 0;
// see setMockVoltage
float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) {
switch(hwChannel) {
case TEST_MAF_CHANNEL:
return testMafValue;
case TEST_CLT_CHANNEL:
return testCltValue;
//return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));
case TEST_IAT_CHANNEL:
return testIatValue;
//return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));
default:
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));;
}

View File

@ -19,8 +19,6 @@
extern int timeNowUs;
extern WarningCodeState unitTestWarningCodeState;
extern float testMafValue;
extern float testCltValue;
extern float testIatValue;
extern engine_configuration_s & activeConfiguration;
EngineTestHelperBase::EngineTestHelperBase() {
@ -61,13 +59,8 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
commonInitEngineController(NULL PASS_ENGINE_PARAMETER_SUFFIX);
engine->engineConfigurationPtr->mafAdcChannel = TEST_MAF_CHANNEL;
engine->engineConfigurationPtr->clt.adcChannel = TEST_CLT_CHANNEL;
engine->engineConfigurationPtr->iat.adcChannel = TEST_IAT_CHANNEL;
// magic voltage to get nice CLT
testCltValue = 1.492964;
Sensor::setMockValue(SensorType::Clt, 70);
// magic voltage to get nice IAT
testIatValue = 4.03646;
Sensor::setMockValue(SensorType::Iat, 30);
// this is needed to have valid CLT and IAT.