diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index e3f3808b93..7171d6f048 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -776,6 +776,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER_SUFFIX); engineConfiguration->globalFuelCorrection = 1; + engineConfiguration->adcVcc = 3.0; engineConfiguration->map.sensor.type = MT_MPX4250; diff --git a/firmware/hw_layer/algo/adc_math.h b/firmware/hw_layer/algo/adc_math.h index 926b546ca4..0c131ac544 100644 --- a/firmware/hw_layer/algo/adc_math.h +++ b/firmware/hw_layer/algo/adc_math.h @@ -9,7 +9,10 @@ #define ADC_MATH_H_ // it is important that this constant is a float, not double literal +#ifndef ADC_VCC +// todo: migrate to engineConfiguration->adcVcc under https://github.com/rusefi/rusefi/issues/442 #define ADC_VCC 3.0f +#endif /* ADC_VCC */ #define ADC_MAX_VALUE 4095 #define adcToVolts(adc) (ADC_VCC / ADC_MAX_VALUE * (adc))