auto-sync
This commit is contained in:
parent
4d2cdf384a
commit
b3c0d3efa3
|
@ -145,7 +145,7 @@ void printSensors(void) {
|
|||
reportSensorF(getCaption(LP_THROTTLE), getTPS(), 2);
|
||||
|
||||
if (engineConfiguration->hasCltSensor) {
|
||||
reportSensorF(getCaption(LP_ECT), getCoolantTemperature(), 2);
|
||||
reportSensorF(getCaption(LP_ECT), getCoolantTemperature(engineConfiguration2), 2);
|
||||
}
|
||||
|
||||
reportSensorF(getCaption(LP_IAT), getIntakeAirTemperature(), 2);
|
||||
|
@ -310,11 +310,11 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
|||
|
||||
scheduleMsg(&logger2, "algo=%s/pump=%s", algorithmToString(engineConfiguration->algorithm), boolToString(getOutputPinValue(FUEL_PUMP_RELAY)));
|
||||
|
||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel());
|
||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(&engine));
|
||||
|
||||
if (engine.rpmCalculator->isRunning()) {
|
||||
float iatCorrection = getIatCorrection(getIntakeAirTemperature());
|
||||
float cltCorrection = getCltCorrection(getCoolantTemperature());
|
||||
float cltCorrection = getCltCorrection(getCoolantTemperature(engineConfiguration2));
|
||||
float injectorLag = getInjectorLag(getVBatt());
|
||||
scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad);
|
||||
scheduleMsg(&logger2, "baseFuel=%f", baseFuel);
|
||||
|
@ -357,7 +357,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels) {
|
|||
#endif
|
||||
|
||||
float tps = getTPS();
|
||||
float coolant = getCoolantTemperature();
|
||||
float coolant = getCoolantTemperature(engineConfiguration2);
|
||||
float intake = getIntakeAirTemperature();
|
||||
|
||||
float engineLoad = getEngineLoad();
|
||||
|
@ -388,13 +388,13 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels) {
|
|||
tsOutputChannels->cylinder_cleanup_enabled = engineConfiguration->isCylinderCleanupEnabled;
|
||||
tsOutputChannels->secondTriggerChannelEnabled = engineConfiguration->secondTriggerChannelEnabled;
|
||||
|
||||
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature());
|
||||
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature(engineConfiguration2));
|
||||
tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature());
|
||||
#endif
|
||||
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake);
|
||||
tsOutputChannels->sparkDwell = getSparkDwellMs(rpm);
|
||||
tsOutputChannels->pulseWidth = getRunningFuel(baseFuel, &engine, rpm);
|
||||
tsOutputChannels->crankingFuel = getCrankingFuel();
|
||||
tsOutputChannels->crankingFuel = getCrankingFuel(&engine);
|
||||
}
|
||||
|
||||
extern TunerStudioOutputChannels tsOutputChannels;
|
||||
|
|
|
@ -23,7 +23,7 @@ static Logging logger;
|
|||
*/
|
||||
void Engine::updateSlowSensors() {
|
||||
engineState.iat = getIntakeAirTemperature();
|
||||
engineState.clt = getCoolantTemperature();
|
||||
engineState.clt = getCoolantTemperature(engineConfiguration2);
|
||||
}
|
||||
|
||||
void Engine::onTriggerEvent(uint64_t nowUs) {
|
||||
|
|
|
@ -73,7 +73,7 @@ static int getNumberOfInjections(engine_configuration_s const *engineConfigurati
|
|||
*/
|
||||
float getFuelMs(int rpm, Engine *engine) {
|
||||
if (isCranking()) {
|
||||
return getCrankingFuel() / getNumberOfInjections(engine->engineConfiguration, engine->engineConfiguration->crankingInjectionMode);
|
||||
return getCrankingFuel(engine) / getNumberOfInjections(engine->engineConfiguration, engine->engineConfiguration->crankingInjectionMode);
|
||||
} else {
|
||||
float baseFuel = getBaseFuel(engine, rpm);
|
||||
float fuelPerCycle = getRunningFuel(baseFuel, engine, rpm);
|
||||
|
@ -84,7 +84,7 @@ float getFuelMs(int rpm, Engine *engine) {
|
|||
// todo: start using 'engine' parameter and not 'extern'
|
||||
float getRunningFuel(float baseFuel, Engine *engine, int rpm) {
|
||||
float iatCorrection = getIatCorrection(getIntakeAirTemperature());
|
||||
float cltCorrection = getCltCorrection(getCoolantTemperature());
|
||||
float cltCorrection = getCltCorrection(getCoolantTemperature(engine->engineConfiguration2));
|
||||
float injectorLag = getInjectorLag(getVBatt());
|
||||
|
||||
#if EFI_ACCEL_ENRICHMENT
|
||||
|
@ -154,8 +154,8 @@ float getBaseTableFuel(int rpm, float engineLoad) {
|
|||
/**
|
||||
* @return Duration of fuel injection while craning, in milliseconds
|
||||
*/
|
||||
float getCrankingFuel(void) {
|
||||
return getStartingFuel(getCoolantTemperature());
|
||||
float getCrankingFuel(Engine *engine) {
|
||||
return getStartingFuel(getCoolantTemperature(engine->engineConfiguration2));
|
||||
}
|
||||
|
||||
float getStartingFuel(float coolantTemperature) {
|
||||
|
|
|
@ -18,7 +18,7 @@ float getIatCorrection(float iat);
|
|||
float getInjectorLag(float vBatt);
|
||||
float getCltCorrection(float clt);
|
||||
float getRunningFuel(float baseFuel, Engine *engine, int rpm);
|
||||
float getCrankingFuel(void);
|
||||
float getCrankingFuel(Engine *engine);
|
||||
float getStartingFuel(float coolantTemperature);
|
||||
float getFuelMs(int rpm, Engine *engine);
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ static void updateErrorCodes(void) {
|
|||
* technically we can set error codes right inside the getMethods, but I a bit on a fence about it
|
||||
*/
|
||||
setError(isValidIntakeAirTemperature(getIntakeAirTemperature()), OBD_Intake_Air_Temperature_Circuit_Malfunction);
|
||||
setError(isValidCoolantTemperature(getCoolantTemperature()), OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
|
||||
setError(isValidCoolantTemperature(getCoolantTemperature(engineConfiguration2)), OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
|
||||
}
|
||||
|
||||
static void fanRelayControl(void) {
|
||||
|
@ -128,9 +128,9 @@ static void fanRelayControl(void) {
|
|||
int newValue;
|
||||
if (isCurrentlyOn) {
|
||||
// if the fan is already on, we keep it on till the 'fanOff' temperature
|
||||
newValue = getCoolantTemperature() > engineConfiguration->fanOffTemperature;
|
||||
newValue = getCoolantTemperature(engineConfiguration2) > engineConfiguration->fanOffTemperature;
|
||||
} else {
|
||||
newValue = getCoolantTemperature() > engineConfiguration->fanOnTemperature;
|
||||
newValue = getCoolantTemperature(engineConfiguration2) > engineConfiguration->fanOnTemperature;
|
||||
}
|
||||
|
||||
if (isCurrentlyOn != newValue) {
|
||||
|
|
|
@ -43,7 +43,7 @@ static char * prepareVBattMapLine(char *buffer) {
|
|||
static char * prepareCltIatTpsLine(char *buffer) {
|
||||
char *ptr = buffer;
|
||||
*ptr++ = 'C';
|
||||
ptr = ftoa(ptr, getCoolantTemperature(), 10.0f);
|
||||
ptr = ftoa(ptr, getCoolantTemperature(engine.engineConfiguration2), 10.0f);
|
||||
|
||||
ptr = appendStr(ptr, " C");
|
||||
ptr = ftoa(ptr, getIntakeAirTemperature(), 10.0f);
|
||||
|
|
|
@ -67,7 +67,7 @@ float getSpeedDensityFuel(Engine *engine, int rpm) {
|
|||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
float tps = getTPS();
|
||||
float coolantC = getCoolantTemperature();
|
||||
float coolantC = getCoolantTemperature(engine->engineConfiguration2);
|
||||
float intakeC = getIntakeAirTemperature();
|
||||
float tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC));
|
||||
float map = getMap();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file allsensors.h
|
||||
* @file allsensors.cpp
|
||||
* @brief
|
||||
*
|
||||
*
|
|
@ -25,16 +25,6 @@
|
|||
#include "adc_math.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void initSensors(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*SENSORS_H_*/
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
|
||||
CONTROLLERS_SENSORS_SRC = $(PROJECT_DIR)/controllers/sensors/allsensors.c \
|
||||
CONTROLLERS_SENSORS_SRC = \
|
||||
$(PROJECT_DIR)/controllers/sensors/maf.c \
|
||||
$(PROJECT_DIR)/controllers/sensors/voltage.c
|
||||
|
||||
CONTROLLERS_SENSORS_SRC_CPP = $(PROJECT_DIR)/controllers/sensors/thermistors.cpp \
|
||||
$(PROJECT_DIR)/controllers/sensors/allsensors.cpp \
|
||||
$(PROJECT_DIR)/controllers/sensors/map.cpp \
|
||||
$(PROJECT_DIR)/controllers/sensors/tps.cpp \
|
||||
$(PROJECT_DIR)/controllers/sensors/ego.cpp
|
||||
|
|
|
@ -107,7 +107,7 @@ bool isValidIntakeAirTemperature(float temperature) {
|
|||
/**
|
||||
* @return coolant temperature, in Celsius
|
||||
*/
|
||||
float getCoolantTemperature(void) {
|
||||
float getCoolantTemperature(engine_configuration2_s * engineConfiguration2) {
|
||||
float temperature = getTemperatureC(&engineConfiguration2->clt);
|
||||
if (!isValidCoolantTemperature(temperature)) {
|
||||
warning(OBD_PCM_Processor_Fault, "unrealistic CLT %f", temperature);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define KELV 273.15
|
||||
|
||||
#include "sensor_types.h"
|
||||
#include "ec2.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
|
@ -37,7 +38,7 @@ float convertFtoCelcius(float tempF);
|
|||
float getKelvinTemperature(float resistance, ThermistorConf *thermistor);
|
||||
float getResistance(Thermistor *thermistor);
|
||||
float getTemperatureC(Thermistor *thermistor);
|
||||
float getCoolantTemperature(void);
|
||||
float getCoolantTemperature(engine_configuration2_s * engineConfiguration2);
|
||||
bool isValidCoolantTemperature(float temperature);
|
||||
float getIntakeAirTemperature(void);
|
||||
bool isValidIntakeAirTemperature(float temperature);
|
||||
|
|
|
@ -289,7 +289,7 @@ static void printTPSInfo(void) {
|
|||
|
||||
static void printTemperatureInfo(void) {
|
||||
printThermistor("CLT", &engineConfiguration2->clt);
|
||||
if (!isValidCoolantTemperature(getCoolantTemperature())) {
|
||||
if (!isValidCoolantTemperature(getCoolantTemperature(engineConfiguration2))) {
|
||||
scheduleMsg(&logger, "CLT sensing error");
|
||||
}
|
||||
printThermistor("IAT", &engineConfiguration2->iat);
|
||||
|
|
|
@ -241,5 +241,5 @@ void firmwareError(const char *fmt, ...) {
|
|||
}
|
||||
|
||||
int getRusEfiVersion(void) {
|
||||
return 20141001;
|
||||
return 20141002;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,6 @@ void assertTrueM(const char *msg, float actual);
|
|||
void assertFalse(float actual);
|
||||
void assertFalseM(const char *msg, float actual);
|
||||
|
||||
float getIntakeAirTemperature(void);
|
||||
float getCoolantTemperature(void);
|
||||
float getVBatt(void);
|
||||
float getMaf(void);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ void testFuelMap(void) {
|
|||
assertEquals(NAN, getIntakeAirTemperature());
|
||||
float iatCorrection = getIatCorrection(-KELV);
|
||||
assertEqualsM("IAT", 2, iatCorrection);
|
||||
float cltCorrection = getCltCorrection(getCoolantTemperature());
|
||||
float cltCorrection = getCltCorrection(getCoolantTemperature(engineConfiguration2));
|
||||
assertEqualsM("CLT", 1, cltCorrection);
|
||||
float injectorLag = getInjectorLag(getVBatt());
|
||||
assertEquals(0, injectorLag);
|
||||
|
|
Loading…
Reference in New Issue