fixing new MAP decoder
This commit is contained in:
parent
3e7adb5ea6
commit
db51fd2c85
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,5 +260,5 @@ int getRusEfiVersion(void) {
|
|||
if (initBootloader() != 0)
|
||||
return 123;
|
||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||
return 20170828;
|
||||
return 20170921;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue