auto-sync
This commit is contained in:
parent
fca2ae324f
commit
75e22583d2
|
@ -182,13 +182,13 @@ void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* IAT <OEM ECU>
|
||||
*/
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_13;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_13;
|
||||
setThermistorConfiguration(&engineConfiguration->iat, -20.0, 15600.0, 23.0, 2250.0, 92.0, 240.0);
|
||||
engineConfiguration->iat.config.bias_resistor = 2660;
|
||||
/**
|
||||
* CLT <LADA Samara>
|
||||
*/
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
||||
setThermistorConfiguration(&engineConfiguration->clt, -20.0, 28680.0, 25.0, 2796.0, 100.0, 177.0);
|
||||
engineConfiguration->iat.config.bias_resistor = 2660;
|
||||
/**
|
||||
|
|
|
@ -37,8 +37,8 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;
|
||||
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_12;
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_12;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_11;
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_13;
|
||||
|
||||
setCommonNTCSensor(&engineConfiguration->clt);
|
||||
|
|
|
@ -326,12 +326,12 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* IAT D15/W7
|
||||
*/
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_11;
|
||||
|
||||
/**
|
||||
* CLT D13/W9
|
||||
*/
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_12;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_12;
|
||||
|
||||
|
||||
boardConfiguration->sensorChartMode = SC_MAP;
|
||||
|
|
|
@ -70,8 +70,8 @@ void setFordInline6(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// input channel 12 is PC1, that's ADC11
|
||||
|
||||
engineConfiguration->tpsAdcChannel = EFI_ADC_4;
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_2;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_2;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_1;
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_11;
|
||||
|
||||
engineConfiguration->map.sensor.type = MT_MPX4250;
|
||||
|
|
|
@ -144,8 +144,8 @@ void setFordAspireEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->vbattAdcChannel = EFI_ADC_0;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
||||
// engineConfiguration->iatAdcChannel =
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
||||
// engineConfiguration->iat.adcChannel =
|
||||
|
||||
engineConfiguration->map.sensor.type = MT_DENSO183;
|
||||
}
|
||||
|
|
|
@ -122,12 +122,12 @@ static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* IAT D15/W7
|
||||
*/
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_11;
|
||||
|
||||
/**
|
||||
* CLT D13/W9
|
||||
*/
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_12;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_12;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -196,7 +196,7 @@ static void common079721_2351(engine_configuration_s *engineConfiguration, board
|
|||
// Frankenstein analog input #12: adc
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->tpsAdcChannel = EFI_ADC_3;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
||||
|
||||
}
|
||||
|
||||
|
@ -349,8 +349,8 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->tpsAdcChannel = EFI_ADC_NONE;
|
||||
// engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_0;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_12;
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_12;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_11;
|
||||
|
||||
// todo: 8.2 or 10k?
|
||||
engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;
|
||||
|
@ -423,8 +423,8 @@ static void setMiata1994_common(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->tpsAdcChannel = EFI_ADC_2;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_0;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_12;
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_12;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_11;
|
||||
// end of 1994 commond
|
||||
}
|
||||
|
||||
|
@ -508,7 +508,7 @@ void setMiata1996(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->idle.solenoidPin = GPIOE_5;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
||||
engineConfiguration->tpsAdcChannel = EFI_ADC_13;
|
||||
|
||||
boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
|
||||
|
|
|
@ -39,8 +39,8 @@ void setMazdaMiataNbEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->vbattAdcChannel = EFI_ADC_0; // 1 is the old value
|
||||
// engineConfiguration->map.channel = 1;
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_13;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_13;
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_2;
|
||||
|
||||
boardConfiguration->idle.solenoidPin = GPIOE_0;
|
||||
|
|
|
@ -76,12 +76,6 @@ Engine::Engine(persistent_config_s *config) {
|
|||
knockNow = false;
|
||||
knockEver = false;
|
||||
|
||||
iat.config = NULL;
|
||||
iat.channel = EFI_ADC_NONE;
|
||||
|
||||
clt.config = NULL;
|
||||
clt.channel = EFI_ADC_NONE;
|
||||
|
||||
injectorLagMs = fuelMs = 0;
|
||||
clutchDownState = clutchUpState = false;
|
||||
memset(&m, 0, sizeof(m));
|
||||
|
|
|
@ -124,11 +124,6 @@ public:
|
|||
|
||||
class RpmCalculator;
|
||||
|
||||
typedef struct {
|
||||
ThermistorConf *config;
|
||||
adc_channel_e channel;
|
||||
} Thermistor;
|
||||
|
||||
#define MAF_DECODING_CACHE_SIZE 256
|
||||
|
||||
#define MAF_DECODING_CACHE_MULT (MAF_DECODING_CACHE_SIZE / 5.0)
|
||||
|
@ -183,9 +178,6 @@ public:
|
|||
*/
|
||||
uint64_t stopEngineRequestTimeNt;
|
||||
|
||||
Thermistor iat;
|
||||
Thermistor clt;
|
||||
|
||||
AccelEnrichmemnt mapAccelEnrichment;
|
||||
AccelEnrichmemnt tpsAccelEnrichment;
|
||||
|
||||
|
|
|
@ -396,8 +396,8 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->alternatorDT = 100;
|
||||
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_NONE;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_6;
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_7;
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_6;
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_7;
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_14;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// this section was generated by config_definition.jar on Fri May 22 14:07:18 EDT 2015
|
||||
// this section was generated by config_definition.jar on Fri May 22 22:10:47 EDT 2015
|
||||
// begin
|
||||
#include "rusefi_types.h"
|
||||
typedef struct {
|
||||
|
@ -141,8 +141,8 @@ typedef struct {
|
|||
/**
|
||||
* offset 28
|
||||
*/
|
||||
float unused[3];
|
||||
/** total size 40*/
|
||||
adc_channel_e adcChannel;
|
||||
/** total size 32*/
|
||||
} ThermistorConf;
|
||||
|
||||
typedef struct {
|
||||
|
@ -732,9 +732,13 @@ typedef struct {
|
|||
*/
|
||||
ThermistorConf clt;
|
||||
/**
|
||||
* offset 296
|
||||
* offset 288
|
||||
*/
|
||||
ThermistorConf iat;
|
||||
/**
|
||||
* offset 320
|
||||
*/
|
||||
float unused[4];
|
||||
/**
|
||||
* offset 336
|
||||
*/
|
||||
|
@ -900,14 +904,13 @@ typedef struct {
|
|||
*/
|
||||
float globalFuelCorrection;
|
||||
/**
|
||||
* todo: merge with channel settings, use full-scale Thermistor!
|
||||
* offset 572
|
||||
*/
|
||||
adc_channel_e cltAdcChannel;
|
||||
int unused11;
|
||||
/**
|
||||
* offset 576
|
||||
*/
|
||||
adc_channel_e iatAdcChannel;
|
||||
int unused12;
|
||||
/**
|
||||
* offset 580
|
||||
*/
|
||||
|
@ -1326,4 +1329,4 @@ typedef struct {
|
|||
} persistent_config_s;
|
||||
|
||||
// end
|
||||
// this section was generated by config_definition.jar on Fri May 22 14:07:18 EDT 2015
|
||||
// this section was generated by config_definition.jar on Fri May 22 22:10:47 EDT 2015
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define LE_COMMAND_LENGTH 200
|
||||
#define TS_FILE_VERSION 20150506
|
||||
#define TS_FILE_VERSION 20150522
|
||||
#define MAP_ANGLE_SIZE 8
|
||||
#define MAP_WINDOW_SIZE 8
|
||||
#define CLT_CURVE_SIZE 16
|
||||
|
@ -87,25 +87,27 @@
|
|||
#define clt_resistance_3_offset_hex 114
|
||||
#define clt_bias_resistor_offset 280
|
||||
#define clt_bias_resistor_offset_hex 118
|
||||
#define clt_unused_offset 284
|
||||
#define iat_offset 296
|
||||
#define iat_offset_hex 128
|
||||
#define iat_config_offset 296
|
||||
#define iat_config_offset_hex 128
|
||||
#define iat_tempC_1_offset 296
|
||||
#define iat_tempC_1_offset_hex 128
|
||||
#define iat_tempC_2_offset 300
|
||||
#define iat_tempC_3_offset 304
|
||||
#define iat_tempC_3_offset_hex 130
|
||||
#define iat_resistance_1_offset 308
|
||||
#define iat_resistance_1_offset_hex 134
|
||||
#define iat_resistance_2_offset 312
|
||||
#define iat_resistance_2_offset_hex 138
|
||||
#define iat_resistance_3_offset 316
|
||||
#define iat_bias_resistor_offset 320
|
||||
#define iat_bias_resistor_offset_hex 140
|
||||
#define iat_unused_offset 324
|
||||
#define iat_unused_offset_hex 144
|
||||
#define clt_adcChannel_offset 284
|
||||
#define iat_offset 288
|
||||
#define iat_offset_hex 120
|
||||
#define iat_config_offset 288
|
||||
#define iat_config_offset_hex 120
|
||||
#define iat_tempC_1_offset 288
|
||||
#define iat_tempC_1_offset_hex 120
|
||||
#define iat_tempC_2_offset 292
|
||||
#define iat_tempC_2_offset_hex 124
|
||||
#define iat_tempC_3_offset 296
|
||||
#define iat_tempC_3_offset_hex 128
|
||||
#define iat_resistance_1_offset 300
|
||||
#define iat_resistance_2_offset 304
|
||||
#define iat_resistance_2_offset_hex 130
|
||||
#define iat_resistance_3_offset 308
|
||||
#define iat_resistance_3_offset_hex 134
|
||||
#define iat_bias_resistor_offset 312
|
||||
#define iat_bias_resistor_offset_hex 138
|
||||
#define iat_adcChannel_offset 316
|
||||
#define unused_offset 320
|
||||
#define unused_offset_hex 140
|
||||
#define sparkDwellBins_offset 336
|
||||
#define sparkDwellBins_offset_hex 150
|
||||
#define sparkDwell_offset 368
|
||||
|
@ -173,9 +175,9 @@
|
|||
#define hip9011SpiDevice_offset_hex 234
|
||||
#define globalFuelCorrection_offset 568
|
||||
#define globalFuelCorrection_offset_hex 238
|
||||
#define cltAdcChannel_offset 572
|
||||
#define iatAdcChannel_offset 576
|
||||
#define iatAdcChannel_offset_hex 240
|
||||
#define unused11_offset 572
|
||||
#define unused12_offset 576
|
||||
#define unused12_offset_hex 240
|
||||
#define mafAdcChannel_offset 580
|
||||
#define mafAdcChannel_offset_hex 244
|
||||
#define afr_offset 584
|
||||
|
|
|
@ -323,9 +323,9 @@ static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) {
|
|||
static void printAnalogInfo(void) {
|
||||
printAnalogChannelInfo("hip9011", EFI_ADC_10);
|
||||
printAnalogChannelInfo("TPS", engineConfiguration->tpsAdcChannel);
|
||||
printAnalogChannelInfo("CLT", engineConfiguration->cltAdcChannel);
|
||||
printAnalogChannelInfo("CLT", engineConfiguration->clt.adcChannel);
|
||||
if (engineConfiguration->hasIatSensor) {
|
||||
printAnalogChannelInfo("IAT", engineConfiguration->iatAdcChannel);
|
||||
printAnalogChannelInfo("IAT", engineConfiguration->iat.adcChannel);
|
||||
}
|
||||
if (hasMafSensor()) {
|
||||
printAnalogChannelInfo("MAF", engineConfiguration->mafAdcChannel);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "engine_configuration.h"
|
||||
#include "engine.h"
|
||||
|
||||
#define FLASH_DATA_VERSION 8080
|
||||
#define FLASH_DATA_VERSION 8100
|
||||
|
||||
void readFromFlash(void);
|
||||
void initFlash(Logging *sharedLogger, Engine *engine);
|
||||
|
|
|
@ -45,11 +45,11 @@ float getVoutInVoltageDividor(float Vin, float r1, float r2) {
|
|||
return r2 * Vin / (r1 + r2);
|
||||
}
|
||||
|
||||
float convertResistanceToKelvinTemperature(float resistance, thermistor_curve_s * curve) {
|
||||
float getKelvinTemperature(float resistance, thermistor_curve_s * curve) {
|
||||
efiAssert(curve != NULL, "thermistor pointer is NULL", NAN);
|
||||
|
||||
if (resistance <= 0) {
|
||||
//warning("Invalid resistance in convertResistanceToKelvinTemperature=", resistance);
|
||||
//warning("Invalid resistance in getKelvinTemperature=", resistance);
|
||||
return 0.0f;
|
||||
}
|
||||
float logR = logf(resistance);
|
||||
|
@ -69,26 +69,21 @@ float convertKelvinToFahrenheit(float kelvin) {
|
|||
return convertCelsiustoF(tempC);
|
||||
}
|
||||
|
||||
float getKelvinTemperature(float resistance, thermistor_curve_s * curve) {
|
||||
// todo: inline thid method
|
||||
return convertResistanceToKelvinTemperature(resistance, curve);
|
||||
}
|
||||
|
||||
float getResistance(Thermistor *thermistor) {
|
||||
float voltage = getVoltageDivided("term", thermistor->channel);
|
||||
efiAssert(thermistor->config != NULL, "thermistor config is null", NAN);
|
||||
thermistor_conf_s *tc = &thermistor->config->config;
|
||||
float getResistance(ThermistorConf *config) {
|
||||
float voltage = getVoltageDivided("term", config->adcChannel);
|
||||
efiAssert(config != NULL, "thermistor config is null", NAN);
|
||||
thermistor_conf_s *tc = &config->config;
|
||||
|
||||
float resistance = getR2InVoltageDividor(voltage, _5_VOLTS, tc->bias_resistor);
|
||||
return resistance;
|
||||
}
|
||||
|
||||
float getTemperatureC(Thermistor *thermistor, thermistor_curve_s * curve) {
|
||||
float getTemperatureC(ThermistorConf *config, thermistor_curve_s * curve) {
|
||||
if (!initialized) {
|
||||
firmwareError("thermstr not initialized");
|
||||
return NAN;
|
||||
}
|
||||
float resistance = getResistance(thermistor);
|
||||
float resistance = getResistance(config);
|
||||
|
||||
float kelvinTemperature = getKelvinTemperature(resistance, curve);
|
||||
return convertKelvinToCelcius(kelvinTemperature);
|
||||
|
@ -108,7 +103,7 @@ bool isValidIntakeAirTemperature(float temperature) {
|
|||
* @return coolant temperature, in Celsius
|
||||
*/
|
||||
float getCoolantTemperature(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float temperature = getTemperatureC(&engine->clt, &engine->engineState.cltCurve.curve);
|
||||
float temperature = getTemperatureC(&engineConfiguration->clt, &engine->engineState.cltCurve.curve);
|
||||
if (!isValidCoolantTemperature(temperature)) {
|
||||
efiAssert(engineConfiguration!=NULL, "NULL engineConfiguration", NAN);
|
||||
if (engineConfiguration->hasCltSensor) {
|
||||
|
@ -173,7 +168,7 @@ void prepareThermistorCurve(ThermistorConf * config, thermistor_curve_s * curve)
|
|||
* @return Celsius value
|
||||
*/
|
||||
float getIntakeAirTemperature(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float temperature = getTemperatureC(&engine->iat, &engine->engineState.iatCurve.curve);
|
||||
float temperature = getTemperatureC(&engineConfiguration->iat, &engine->engineState.iatCurve.curve);
|
||||
if (!isValidIntakeAirTemperature(temperature)) {
|
||||
efiAssert(engineConfiguration!=NULL, "NULL engineConfiguration", NAN);
|
||||
if (engineConfiguration->hasIatSensor) {
|
||||
|
@ -184,13 +179,6 @@ float getIntakeAirTemperature(DECLARE_ENGINE_PARAMETER_F) {
|
|||
return temperature;
|
||||
}
|
||||
|
||||
static void initThermistorCurve(Thermistor * t, ThermistorConf *config, adc_channel_e channel,
|
||||
thermistor_curve_s * curve) {
|
||||
prepareThermistorCurve(config, curve);
|
||||
t->config = config;
|
||||
t->channel = channel;
|
||||
}
|
||||
|
||||
void setDodgeSensor(ThermistorConf *thermistorConf) {
|
||||
setThermistorConfiguration(thermistorConf, -40, 336660, 30, 7550, 120, 390);
|
||||
}
|
||||
|
@ -208,12 +196,10 @@ void setCommonNTCSensor(ThermistorConf *thermistorConf) {
|
|||
|
||||
#if EFI_PROD_CODE
|
||||
static void testCltByR(float resistance) {
|
||||
Thermistor *thermistor = &engine->clt;
|
||||
float kTemp = getKelvinTemperature(resistance, &engine->engineState.cltCurve.curve);
|
||||
scheduleMsg(logger, "for R=%f we have %f", resistance, (kTemp - KELV));
|
||||
|
||||
initThermistorCurve(&engine->clt, &engineConfiguration->clt, engineConfiguration->cltAdcChannel,
|
||||
&engine->engineState.cltCurve.curve);
|
||||
prepareThermistorCurve(&engineConfiguration->clt, &engine->engineState.cltCurve.curve);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -222,9 +208,9 @@ void initThermistors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
|||
logger = sharedLogger;
|
||||
efiAssertVoid(engine!=NULL, "e NULL initThermistors");
|
||||
efiAssertVoid(engine->engineConfiguration2!=NULL, "e2 NULL initThermistors");
|
||||
initThermistorCurve(&engine->clt, &engineConfiguration->clt, engineConfiguration->cltAdcChannel,
|
||||
prepareThermistorCurve(&engineConfiguration->clt,
|
||||
&engine->engineState.cltCurve.curve);
|
||||
initThermistorCurve(&engine->iat, &engineConfiguration->iat, engineConfiguration->iatAdcChannel,
|
||||
prepareThermistorCurve(&engineConfiguration->iat,
|
||||
&engine->engineState.iatCurve.curve);
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
|
|
|
@ -32,15 +32,13 @@ float convertCelciustoF(float tempC);
|
|||
float convertFtoCelcius(float tempF);
|
||||
|
||||
float getKelvinTemperature(float resistance, thermistor_curve_s * curve);
|
||||
float getResistance(Thermistor *thermistor);
|
||||
float getTemperatureC(Thermistor *thermistor, thermistor_curve_s * curve);
|
||||
float getResistance(ThermistorConf *config);
|
||||
float getTemperatureC(ThermistorConf *config, thermistor_curve_s * curve);
|
||||
float getCoolantTemperature(DECLARE_ENGINE_PARAMETER_F);
|
||||
bool isValidCoolantTemperature(float temperature);
|
||||
float getIntakeAirTemperature(DECLARE_ENGINE_PARAMETER_F);
|
||||
bool isValidIntakeAirTemperature(float temperature);
|
||||
|
||||
float convertResistanceToKelvinTemperature(float resistance,
|
||||
thermistor_curve_s * curve);
|
||||
void setThermistorConfiguration(ThermistorConf * tc, float temp1, float r1, float temp2, float r2, float temp3,
|
||||
float r3);
|
||||
void prepareThermistorCurve(ThermistorConf * config, thermistor_curve_s * curve);
|
||||
|
|
|
@ -367,14 +367,14 @@ static void setOM(int value) {
|
|||
|
||||
static char pinNameBuffer[16];
|
||||
|
||||
static void printThermistor(const char *msg, Thermistor *thermistor, thermistor_curve_s * curve) {
|
||||
adc_channel_e adcChannel = thermistor->channel;
|
||||
static void printThermistor(const char *msg, ThermistorConf *config, thermistor_curve_s * curve) {
|
||||
adc_channel_e adcChannel = config->adcChannel;
|
||||
float voltage = getVoltageDivided("term", adcChannel);
|
||||
float r = getResistance(thermistor);
|
||||
float r = getResistance(config);
|
||||
|
||||
float t = getTemperatureC(thermistor, curve);
|
||||
float t = getTemperatureC(config, curve);
|
||||
|
||||
thermistor_conf_s *tc = &thermistor->config->config;
|
||||
thermistor_conf_s *tc = &config->config;
|
||||
|
||||
scheduleMsg(&logger, "%s volts=%f Celsius=%f sensorR=%f on channel %d", msg, voltage, t, r, adcChannel);
|
||||
scheduleMsg(&logger, "@%s", getPinNameByAdcChannel(adcChannel, pinNameBuffer));
|
||||
|
@ -428,11 +428,11 @@ static void printTPSInfo(void) {
|
|||
|
||||
static void printTemperatureInfo(void) {
|
||||
#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__)
|
||||
printThermistor("CLT", &engine->clt, &engine->engineState.cltCurve.curve);
|
||||
printThermistor("CLT", &engineConfiguration->clt, &engine->engineState.cltCurve.curve);
|
||||
if (!isValidCoolantTemperature(getCoolantTemperature(PASS_ENGINE_PARAMETER_F))) {
|
||||
scheduleMsg(&logger, "CLT sensing error");
|
||||
}
|
||||
printThermistor("IAT", &engine->iat, &engine->engineState.iatCurve.curve);
|
||||
printThermistor("IAT", &engineConfiguration->iat, &engine->engineState.iatCurve.curve);
|
||||
if (!isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F))) {
|
||||
scheduleMsg(&logger, "IAT sensing error");
|
||||
}
|
||||
|
@ -731,10 +731,10 @@ static void setAnalogInputPin(const char *sensorStr, const char *pinName) {
|
|||
engineConfiguration->map.sensor.hwChannel = channel;
|
||||
scheduleMsg(&logger, "setting MAP to %s/%d", pinName, channel);
|
||||
} else if (strEqual("clt", sensorStr)) {
|
||||
engineConfiguration->cltAdcChannel = channel;
|
||||
engineConfiguration->clt.adcChannel = channel;
|
||||
scheduleMsg(&logger, "setting CLT to %s/%d", pinName, channel);
|
||||
} else if (strEqual("iat", sensorStr)) {
|
||||
engineConfiguration->iatAdcChannel = channel;
|
||||
engineConfiguration->iat.adcChannel = channel;
|
||||
scheduleMsg(&logger, "setting IAT to %s/%d", pinName, channel);
|
||||
} else if (strEqual("tps", sensorStr)) {
|
||||
engineConfiguration->tpsAdcChannel = channel;
|
||||
|
|
|
@ -492,8 +492,8 @@ static void configureInputs(void) {
|
|||
addChannel("hip", engineConfiguration->hipOutputChannel, ADC_FAST);
|
||||
|
||||
addChannel("VBatt", engineConfiguration->vbattAdcChannel, ADC_SLOW);
|
||||
addChannel("CLT", engineConfiguration->cltAdcChannel, ADC_SLOW);
|
||||
addChannel("IAT", engineConfiguration->iatAdcChannel, ADC_SLOW);
|
||||
addChannel("CLT", engineConfiguration->clt.adcChannel, ADC_SLOW);
|
||||
addChannel("IAT", engineConfiguration->iat.adcChannel, ADC_SLOW);
|
||||
addChannel("AFR", engineConfiguration->afr.hwChannel, ADC_SLOW);
|
||||
addChannel("AC", engineConfiguration->acSwitchAdc, ADC_SLOW);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ struct_no_prefix engine_configuration_s
|
|||
!
|
||||
! this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version
|
||||
!
|
||||
#define TS_FILE_VERSION 20150506
|
||||
#define TS_FILE_VERSION 20150522
|
||||
|
||||
|
||||
#define MAP_ANGLE_SIZE 8
|
||||
|
@ -119,7 +119,7 @@ end_struct
|
|||
|
||||
struct ThermistorConf @brief Thermistor curve parameters
|
||||
thermistor_conf_s config;
|
||||
float[3] unused;
|
||||
adc_channel_e adcChannel;
|
||||
end_struct
|
||||
|
||||
custom engine_type_e 4 bits, S32, @OFFSET@, [0:2], "AUDI_AAN", "DODGE_NEON_1995", "FORD_ASPIRE_1996", "FORD_FIESTA", "NISSAN_PRIMERA", "HONDA_ACCORD", "FORD_INLINE_6_1995", "GY6_139QMB"
|
||||
|
@ -158,6 +158,9 @@ MAP_sensor_config_s map;@see hasMapSensor\n@see isMapAveragingEnabled
|
|||
|
||||
ThermistorConf clt;todo: merge with channel settings, use full-scale Thermistor here!
|
||||
ThermistorConf iat;
|
||||
|
||||
float[4] unused;
|
||||
|
||||
|
||||
float[DWELL_CURVE_SIZE] sparkDwellBins;;"RPM", 1, 0.0, 0.0, 18000, 2
|
||||
float[DWELL_CURVE_SIZE] sparkDwell;;"ms", 1, 0.0, 0.0, 30.0, 2
|
||||
|
@ -269,8 +272,8 @@ custom spi_device_e 4 bits,U32, @OFFSET@, [0:1], "Off", "SPI1", "SPI2", "SPI3"
|
|||
float globalFuelCorrection;;"coef", 1, 0.0, 0, 1000.0, 2
|
||||
|
||||
|
||||
adc_channel_e cltAdcChannel;todo: merge with channel settings, use full-scale Thermistor!
|
||||
adc_channel_e iatAdcChannel;
|
||||
int unused11;
|
||||
int unused12;
|
||||
adc_channel_e mafAdcChannel;
|
||||
|
||||
struct afr_sensor_s
|
||||
|
|
|
@ -40,7 +40,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated by ConfigDefinition.jar on Fri May 22 14:07:20 EDT 2015
|
||||
; this section was generated by ConfigDefinition.jar on Fri May 22 22:10:51 EDT 2015
|
||||
|
||||
pageSize = 15288
|
||||
page = 1
|
||||
|
@ -76,15 +76,16 @@ page = 1
|
|||
clt_resistance_2 = scalar, F32, 272, "Ohm", 1, 0, 0, 200000, 1
|
||||
clt_resistance_3 = scalar, F32, 276, "Ohm", 1, 0, 0, 200000, 1
|
||||
clt_bias_resistor = scalar, F32, 280, "Ohm", 1, 0, 0, 200000, 1
|
||||
;skipping clt_unused offset 284
|
||||
iat_tempC_1 = scalar, F32, 296, "*C", 1, 0, -40, 200, 1
|
||||
iat_tempC_2 = scalar, F32, 300, "*C", 1, 0, -40, 200, 1
|
||||
iat_tempC_3 = scalar, F32, 304, "*C", 1, 0, -40, 200, 1
|
||||
iat_resistance_1 = scalar, F32, 308, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_resistance_2 = scalar, F32, 312, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_resistance_3 = scalar, F32, 316, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_bias_resistor = scalar, F32, 320, "Ohm", 1, 0, 0, 200000, 1
|
||||
;skipping iat_unused offset 324
|
||||
clt_adcChannel = bits, U32, 284, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
iat_tempC_1 = scalar, F32, 288, "*C", 1, 0, -40, 200, 1
|
||||
iat_tempC_2 = scalar, F32, 292, "*C", 1, 0, -40, 200, 1
|
||||
iat_tempC_3 = scalar, F32, 296, "*C", 1, 0, -40, 200, 1
|
||||
iat_resistance_1 = scalar, F32, 300, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_resistance_2 = scalar, F32, 304, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_resistance_3 = scalar, F32, 308, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_bias_resistor = scalar, F32, 312, "Ohm", 1, 0, 0, 200000, 1
|
||||
iat_adcChannel = bits, U32, 316, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
;skipping unused offset 320
|
||||
sparkDwellBins = array, F32, 336, [8], "RPM", 1, 0.0, 0.0, 18000, 2
|
||||
sparkDwell = array, F32, 368, [8], "ms", 1, 0.0, 0.0, 30.0, 2
|
||||
displacement = scalar, F32, 400, "L", 1, 0, 0, 1000.0, 2
|
||||
|
@ -131,8 +132,8 @@ page = 1
|
|||
trigger_customUseRiseEdge = bits, U32, 560, [0:0], "false", "true"
|
||||
hip9011SpiDevice = bits,U32, 564, [0:1], "Off", "SPI1", "SPI2", "SPI3"
|
||||
globalFuelCorrection = scalar, F32, 568, "coef", 1, 0.0, 0, 1000.0, 2
|
||||
cltAdcChannel = bits, U32, 572, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
iatAdcChannel = bits, U32, 576, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
;skipping unused11 offset 572
|
||||
;skipping unused12 offset 576
|
||||
mafAdcChannel = bits, U32, 580, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
afr_hwChannel = bits, U32, 584, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
afr_v1 = scalar, F32, 588, "volts", 1, 0.0, 0, 10.0, 2
|
||||
|
@ -543,7 +544,7 @@ page = 1
|
|||
[OutputChannels]
|
||||
|
||||
; see TS_FILE_VERSION in firmware code
|
||||
fileVersion = { 20150506 }
|
||||
fileVersion = { 20150522 }
|
||||
|
||||
ochGetCommand = "O"
|
||||
|
||||
|
@ -1050,7 +1051,7 @@ fileVersion = { 20150506 }
|
|||
field = "Highest temperature", clt_tempC_3
|
||||
field = "Resistance @ HT", clt_resistance_3
|
||||
dialog = cltSensor_IO, "CLT Sensor I/O"
|
||||
field = "CLT ADC input", cltAdcChannel
|
||||
field = "CLT ADC input", clt_adcChannel
|
||||
field = "Bias Resistor Value", clt_bias_resistor
|
||||
dialog = cltSensor, "", yAxis
|
||||
panel = clt_thermistor, North
|
||||
|
@ -1070,7 +1071,7 @@ fileVersion = { 20150506 }
|
|||
field = "Highest temperature", iat_tempC_3
|
||||
field = "Resistance @ HT", iat_resistance_3
|
||||
dialog = iatSensor_IO, "IAT Sensor I/O"
|
||||
field = "IAT ADC input", iatAdcChannel
|
||||
field = "IAT ADC input", iat_adcChannel
|
||||
field = "Bias Resistor Value", iat_bias_resistor
|
||||
dialog = iatSensor, "", yAxis
|
||||
panel = iat_thermistor, North
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file test_sensors.c
|
||||
* @file test_sensors.cpp
|
||||
*
|
||||
* @date Dec 7, 2013
|
||||
* @author Andrey Belomutskiy, (c) 2012-2015
|
||||
|
@ -97,7 +97,7 @@ void testSensors(void) {
|
|||
assertEquals(0.001, curve->s_h_b);
|
||||
assertEquals(0.0, curve->s_h_c);
|
||||
|
||||
float t = convertResistanceToKelvinTemperature(2100, curve);
|
||||
float t = getKelvinTemperature(2100, curve);
|
||||
assertEquals(75 + KELV, t);
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ void testSensors(void) {
|
|||
assertEqualsM("A", 0.0009, curve->s_h_a);
|
||||
assertEqualsM("B", 0.0003, curve->s_h_b);
|
||||
assertEquals(0.0, curve->s_h_c);
|
||||
float t = convertResistanceToKelvinTemperature(38000, curve);
|
||||
float t = getKelvinTemperature(38000, curve);
|
||||
assertEquals(-2.7983, t - KELV);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,11 +25,11 @@ static void setVoltage(int hwChannel, float voltage) {
|
|||
}
|
||||
|
||||
static void setCltVoltage(float voltage) {
|
||||
setVoltage(engineConfiguration->cltAdcChannel, voltage);
|
||||
setVoltage(engineConfiguration->clt.adcChannel, voltage);
|
||||
}
|
||||
|
||||
static void setIatVoltage(float voltage) {
|
||||
setVoltage(engineConfiguration->iatAdcChannel, voltage);
|
||||
setVoltage(engineConfiguration->iat.adcChannel, voltage);
|
||||
}
|
||||
|
||||
static void setMafVoltage(float voltage) {
|
||||
|
|
Loading…
Reference in New Issue