auto-sync

This commit is contained in:
rusEfi 2016-12-21 18:01:56 -05:00
parent 483d870175
commit 73ac4177b5
4 changed files with 10 additions and 7 deletions

View File

@ -57,7 +57,7 @@ class ThermistorMath {
public:
ThermistorMath();
thermistor_curve_s curve;
void init(thermistor_conf_s *config);
void setConfig(thermistor_conf_s *config);
private:
thermistor_conf_s currentConfig;
};

View File

@ -452,12 +452,14 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
// todo: this value is way off! I am pretty sure temp coeffs are off also
engineConfiguration->iat.config.bias_resistor = 2700;
engineConfiguration->auxTempSensor1.adcChannel = EFI_ADC_NONE;
engineConfiguration->auxTempSensor2.adcChannel = EFI_ADC_NONE;
#if EFI_PROD_CODE
#if EFI_PROD_CODE || defined(__DOXYGEN__)
engineConfiguration->warningPeriod = 10;
#else
engineConfiguration->warningPeriod = 0;
#endif
#endif /* EFI_PROD_CODE */
engineConfiguration->step1rpm = 3000;
engineConfiguration->step1timing = 10;

View File

@ -16,6 +16,8 @@
#include "engine_configuration.h"
#include "engine_math.h"
#define _5_VOLTS 5.0
// Celsius
#define NO_IAT_SENSOR_TEMPERATURE 32.0f
#define LIMPING_MODE_IAT_TEMPERATURE 30.0f
@ -48,7 +50,7 @@ float getVoutInVoltageDividor(float Vin, float r1, float r2) {
}
float getKelvinTemperature(ThermistorConf *config, float resistance, ThermistorMath *tm) {
tm->init(&config->config); // implementation checks if config has changed or not
tm->setConfig(&config->config); // implementation checks if config has changed or not
thermistor_curve_s * curve = &tm->curve;
efiAssert(curve != NULL, "thermistor pointer is NULL", NAN);
@ -223,7 +225,7 @@ void initThermistors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
logger = sharedLogger;
efiAssertVoid(engine!=NULL, "e NULL initThermistors");
#if EFI_PROD_CODE
#if EFI_PROD_CODE || defined(__DOXYGEN__)
addConsoleActionF("test_clt_by_r", testCltByR);
#endif
@ -235,7 +237,7 @@ ThermistorMath::ThermistorMath() {
memset(&curve, 0, sizeof(curve));
}
void ThermistorMath::init(thermistor_conf_s *config) {
void ThermistorMath::setConfig(thermistor_conf_s *config) {
bool isSameConfig = memcmp(config, &currentConfig, sizeof(currentConfig)) == 0;
if (isSameConfig) {
return;

View File

@ -10,7 +10,6 @@
#include "main.h"
#define _5_VOLTS 5.0
#define KELV 273.15f
#include "sensor_types.h"