auto-sync
This commit is contained in:
parent
19927a8e70
commit
a4129ffd10
|
@ -382,7 +382,7 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
initSensors(PASS_ENGINE_PARAMETER_F);
|
initSensors(sharedLogger PASS_ENGINE_PARAMETER_F);
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
initPwmGenerator();
|
initPwmGenerator();
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "allsensors.h"
|
#include "allsensors.h"
|
||||||
|
|
||||||
void initSensors(DECLARE_ENGINE_PARAMETER_F) {
|
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
initThermistors(PASS_ENGINE_PARAMETER_F);
|
initThermistors(sharedLogger PASS_ENGINE_PARAMETER);
|
||||||
initMapDecoder(PASS_ENGINE_PARAMETER_F);
|
initMapDecoder(PASS_ENGINE_PARAMETER_F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "adc_math.h"
|
#include "adc_math.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void initSensors(DECLARE_ENGINE_PARAMETER_F);
|
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||||
|
|
||||||
bool getAcToggle(Engine *engine);
|
bool getAcToggle(Engine *engine);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
#define LIMPING_MODE_IAT_TEMPERATURE 30.0f
|
#define LIMPING_MODE_IAT_TEMPERATURE 30.0f
|
||||||
#define LIMPING_MODE_CLT_TEMPERATURE 70.0f
|
#define LIMPING_MODE_CLT_TEMPERATURE 70.0f
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE
|
||||||
|
;
|
||||||
|
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
|
@ -182,12 +183,25 @@ void setCommonNTCSensor(ThermistorConf *thermistorConf) {
|
||||||
setThermistorConfiguration(thermistorConf, -20, 18000, 23.8889, 2100, 120.0, 100.0);
|
setThermistorConfiguration(thermistorConf, -20, 18000, 23.8889, 2100, 120.0, 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initThermistors(DECLARE_ENGINE_PARAMETER_F) {
|
static Logging *logger;
|
||||||
|
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
static void testCltByR(float resistance) {
|
||||||
|
Thermistor *thermistor = &engine->clt;
|
||||||
|
float kTemp = getKelvinTemperature(resistance, thermistor->config);
|
||||||
|
scheduleMsg(logger, "for R=%f we have %f", resistance, (kTemp - KELV));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void initThermistors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
efiAssertVoid(engine!=NULL, "e NULL initThermistors");
|
efiAssertVoid(engine!=NULL, "e NULL initThermistors");
|
||||||
efiAssertVoid(engine->engineConfiguration2!=NULL, "e2 NULL initThermistors");
|
efiAssertVoid(engine->engineConfiguration2!=NULL, "e2 NULL initThermistors");
|
||||||
initThermistorCurve(&engine->clt, &engine->engineConfiguration->clt,
|
initThermistorCurve(&engine->clt, &engine->engineConfiguration->clt, engine->engineConfiguration->cltAdcChannel);
|
||||||
engine->engineConfiguration->cltAdcChannel);
|
initThermistorCurve(&engine->iat, &engine->engineConfiguration->iat, engine->engineConfiguration->iatAdcChannel);
|
||||||
initThermistorCurve(&engine->iat, &engine->engineConfiguration->iat,
|
|
||||||
engine->engineConfiguration->iatAdcChannel);
|
#if EFI_PROD_CODE
|
||||||
|
addConsoleActionF("test_clt_by_r", testCltByR);
|
||||||
|
#endif
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,17 +47,8 @@ void prepareThermistorCurve(ThermistorConf * config);
|
||||||
|
|
||||||
class Engine;
|
class Engine;
|
||||||
|
|
||||||
void initThermistors(DECLARE_ENGINE_PARAMETER_F);
|
void initThermistors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||||
|
|
||||||
void setCommonNTCSensor(ThermistorConf *thermistorConf);
|
void setCommonNTCSensor(ThermistorConf *thermistorConf);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* THERMISTORS_H_ */
|
#endif /* THERMISTORS_H_ */
|
||||||
|
|
|
@ -88,7 +88,7 @@ static void usTimerWatchDog(void) {
|
||||||
|
|
||||||
msg = isTimerPending ? "No_cb too long" : "Timer not awhile";
|
msg = isTimerPending ? "No_cb too long" : "Timer not awhile";
|
||||||
// 2 seconds of inactivity would not look right
|
// 2 seconds of inactivity would not look right
|
||||||
efiAssert(getTimeNowNt() < lastSetTimerTimeNt + 2 * CORE_CLOCK, msg, -1);
|
efiAssertVoid(getTimeNowNt() < lastSetTimerTimeNt + 2 * CORE_CLOCK, msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ void testFuelMap(void) {
|
||||||
Engine *engine = ð.engine;
|
Engine *engine = ð.engine;
|
||||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||||
|
|
||||||
initThermistors(PASS_ENGINE_PARAMETER_F);
|
initThermistors(NULL PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
|
|
||||||
printf("*** getInjectorLag\r\n");
|
printf("*** getInjectorLag\r\n");
|
||||||
|
|
|
@ -67,15 +67,29 @@ void testSensors(void) {
|
||||||
testTpsRateOfChange();
|
testTpsRateOfChange();
|
||||||
testHip9011lookup();
|
testHip9011lookup();
|
||||||
|
|
||||||
setThermistorConfiguration(&tc, 32, 9500, 75, 2100, 120, 1000);
|
{
|
||||||
|
setThermistorConfiguration(&tc, 32, 9500, 75, 2100, 120, 1000);
|
||||||
|
|
||||||
prepareThermistorCurve(&tc);
|
prepareThermistorCurve(&tc);
|
||||||
|
|
||||||
assertEquals(-0.003, tc.s_h_a);
|
assertEquals(-0.003, tc.s_h_a);
|
||||||
assertEquals(0.001, tc.s_h_b);
|
assertEquals(0.001, tc.s_h_b);
|
||||||
assertEquals(0.0, tc.s_h_c);
|
assertEquals(0.0, tc.s_h_c);
|
||||||
|
|
||||||
float t = convertResistanceToKelvinTemperature(2100, &tc);
|
float t = convertResistanceToKelvinTemperature(2100, &tc);
|
||||||
assertEquals(75 + KELV, t);
|
assertEquals(75 + KELV, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 2003 Neon sensor
|
||||||
|
setThermistorConfiguration(&tc, 0, 32500, 30, 7550, 100, 700);
|
||||||
|
prepareThermistorCurve(&tc);
|
||||||
|
|
||||||
|
assertEqualsM("A", 0.0009, tc.s_h_a);
|
||||||
|
assertEqualsM("B", 0.0003, tc.s_h_b);
|
||||||
|
assertEquals(0.0, tc.s_h_c);
|
||||||
|
float t = convertResistanceToKelvinTemperature(38000, &tc);
|
||||||
|
assertEquals(-2.7983, t - KELV);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -372,7 +372,7 @@ static void testRpmCalculator(void) {
|
||||||
Engine *engine = ð.engine;
|
Engine *engine = ð.engine;
|
||||||
engine_configuration_s *engineConfiguration = ð.persistentConfig.engineConfiguration;
|
engine_configuration_s *engineConfiguration = ð.persistentConfig.engineConfiguration;
|
||||||
|
|
||||||
initThermistors(PASS_ENGINE_PARAMETER_F);
|
initThermistors(NULL PASS_ENGINE_PARAMETER);
|
||||||
engine->updateSlowSensors();
|
engine->updateSlowSensors();
|
||||||
|
|
||||||
engineConfiguration->trigger.customTotalToothCount = 8;
|
engineConfiguration->trigger.customTotalToothCount = 8;
|
||||||
|
|
|
@ -87,7 +87,7 @@ void rusEfiFunctionalTest(void) {
|
||||||
resetConfigurationExt(NULL, FORD_ESCORT_GT, engine);
|
resetConfigurationExt(NULL, FORD_ESCORT_GT, engine);
|
||||||
prepareShapes(engine);
|
prepareShapes(engine);
|
||||||
|
|
||||||
initSensors(PASS_ENGINE_PARAMETER_F);
|
initSensors(&sharedLogger PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
initAlgo(&sharedLogger, engineConfiguration);
|
initAlgo(&sharedLogger, engineConfiguration);
|
||||||
initRpmCalculator(engine);
|
initRpmCalculator(engine);
|
||||||
|
|
Loading…
Reference in New Issue