fixing new MAP decoder

This commit is contained in:
rusEfi 2017-09-21 23:31:46 -04:00
parent 3e7adb5ea6
commit db51fd2c85
2 changed files with 8 additions and 11 deletions

View File

@ -71,6 +71,8 @@ static FastInterpolation densoToyota(3.7 - 2 /* volts */, 33.322271 /* kPa */, 3
*/
static FastInterpolation *mapDecoder;
static FastInterpolation *getDecoder(air_pressure_sensor_type_e type);
float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
switch (mapConfig->type) {
case MT_CUSTOM:
@ -78,23 +80,16 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DEC
return interpolate(engineConfiguration->mapLowValueVoltage, mapConfig->lowValue,
engineConfiguration->mapHighValueVoltage, mapConfig->highValue, voltage);
case MT_DENSO183:
return denso183.getValue(voltage);
case MT_MPX4250:
return mpx4250.getValue(voltage);
case MT_HONDA3BAR:
return honda3bar.getValue(voltage);
case MT_DODGE_NEON_2003:
return dodgeNeon2003.getValue(voltage);
case MT_SUBY_DENSO:
return subyDenso.getValue(voltage);
case MT_GM_3_BAR:
return gm3bar.getValue(voltage);
case MT_TOYOTA_89420_02010:
return densoToyota.getValue(voltage);
case MT_MPX4100:
return mpx4100.getValue(voltage);
return getDecoder(mapConfig->type)->getValue(voltage);
default:
firmwareError(CUSTOM_ERR_MAP_TYPE, "Unknown MAP type: %d", mapConfig->type);
firmwareError(CUSTOM_ERR_MAP_TYPE, "Unknown MAP type: p %d", mapConfig->type);
return NAN;
}
}
@ -168,8 +163,10 @@ static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) {
return &subyDenso;
case MT_GM_3_BAR:
return &gm3bar;
case MT_TOYOTA_89420_02010:
return &densoToyota;
default:
firmwareError(CUSTOM_ERR_MAP_TYPE, "Unknown MAP type: %d", type);
firmwareError(CUSTOM_ERR_MAP_TYPE, "Unknown MAP type: d %d", type);
return &customMap;
}
}

View File

@ -260,5 +260,5 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20170828;
return 20170921;
}