auto-sync
This commit is contained in:
parent
19927a8e70
commit
a4129ffd10
|
@ -382,7 +382,7 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
|||
return;
|
||||
}
|
||||
|
||||
initSensors(PASS_ENGINE_PARAMETER_F);
|
||||
initSensors(sharedLogger PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
initPwmGenerator();
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include "engine.h"
|
||||
#include "allsensors.h"
|
||||
|
||||
void initSensors(DECLARE_ENGINE_PARAMETER_F) {
|
||||
initThermistors(PASS_ENGINE_PARAMETER_F);
|
||||
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
initThermistors(sharedLogger PASS_ENGINE_PARAMETER);
|
||||
initMapDecoder(PASS_ENGINE_PARAMETER_F);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "adc_math.h"
|
||||
#endif
|
||||
|
||||
void initSensors(DECLARE_ENGINE_PARAMETER_F);
|
||||
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
bool getAcToggle(Engine *engine);
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
#define LIMPING_MODE_IAT_TEMPERATURE 30.0f
|
||||
#define LIMPING_MODE_CLT_TEMPERATURE 70.0f
|
||||
|
||||
EXTERN_ENGINE;
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
static bool initialized = false;
|
||||
|
||||
|
@ -182,12 +183,25 @@ void setCommonNTCSensor(ThermistorConf *thermistorConf) {
|
|||
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->engineConfiguration2!=NULL, "e2 NULL initThermistors");
|
||||
initThermistorCurve(&engine->clt, &engine->engineConfiguration->clt,
|
||||
engine->engineConfiguration->cltAdcChannel);
|
||||
initThermistorCurve(&engine->iat, &engine->engineConfiguration->iat,
|
||||
engine->engineConfiguration->iatAdcChannel);
|
||||
initThermistorCurve(&engine->clt, &engine->engineConfiguration->clt, engine->engineConfiguration->cltAdcChannel);
|
||||
initThermistorCurve(&engine->iat, &engine->engineConfiguration->iat, engine->engineConfiguration->iatAdcChannel);
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
addConsoleActionF("test_clt_by_r", testCltByR);
|
||||
#endif
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
|
|
@ -47,17 +47,8 @@ void prepareThermistorCurve(ThermistorConf * config);
|
|||
|
||||
class Engine;
|
||||
|
||||
void initThermistors(DECLARE_ENGINE_PARAMETER_F);
|
||||
void initThermistors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
void setCommonNTCSensor(ThermistorConf *thermistorConf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* THERMISTORS_H_ */
|
||||
|
|
|
@ -88,7 +88,7 @@ static void usTimerWatchDog(void) {
|
|||
|
||||
msg = isTimerPending ? "No_cb too long" : "Timer not awhile";
|
||||
// 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_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
initThermistors(PASS_ENGINE_PARAMETER_F);
|
||||
initThermistors(NULL PASS_ENGINE_PARAMETER);
|
||||
|
||||
|
||||
printf("*** getInjectorLag\r\n");
|
||||
|
|
|
@ -67,15 +67,29 @@ void testSensors(void) {
|
|||
testTpsRateOfChange();
|
||||
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.001, tc.s_h_b);
|
||||
assertEquals(0.0, tc.s_h_c);
|
||||
assertEquals(-0.003, tc.s_h_a);
|
||||
assertEquals(0.001, tc.s_h_b);
|
||||
assertEquals(0.0, tc.s_h_c);
|
||||
|
||||
float t = convertResistanceToKelvinTemperature(2100, &tc);
|
||||
assertEquals(75 + KELV, t);
|
||||
float t = convertResistanceToKelvinTemperature(2100, &tc);
|
||||
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_configuration_s *engineConfiguration = ð.persistentConfig.engineConfiguration;
|
||||
|
||||
initThermistors(PASS_ENGINE_PARAMETER_F);
|
||||
initThermistors(NULL PASS_ENGINE_PARAMETER);
|
||||
engine->updateSlowSensors();
|
||||
|
||||
engineConfiguration->trigger.customTotalToothCount = 8;
|
||||
|
|
|
@ -87,7 +87,7 @@ void rusEfiFunctionalTest(void) {
|
|||
resetConfigurationExt(NULL, FORD_ESCORT_GT, engine);
|
||||
prepareShapes(engine);
|
||||
|
||||
initSensors(PASS_ENGINE_PARAMETER_F);
|
||||
initSensors(&sharedLogger PASS_ENGINE_PARAMETER);
|
||||
|
||||
initAlgo(&sharedLogger, engineConfiguration);
|
||||
initRpmCalculator(engine);
|
||||
|
|
Loading…
Reference in New Issue