diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 15021b2e7e..6127661e52 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -369,7 +369,7 @@ static void printSensors(Logging *log) { if (engineConfiguration->fsioAdc[i] != EFI_ADC_NONE) { strcpy(buf, "adcX"); buf[3] = '0' + i; - reportSensorF(log, buf, "", getVoltage("fsio", engineConfiguration->fsioAdc[i]), 2); + reportSensorF(log, buf, "", getVoltage("fsio", engineConfiguration->fsioAdc[i] PASS_ENGINE_PARAMETER_SUFFIX), 2); } } @@ -939,7 +939,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ // todo: implement a proper loop if (engineConfiguration->fsioAdc[0] != EFI_ADC_NONE) { strcpy(buf, "adcX"); - tsOutputChannels->debugFloatField1 = getVoltage("fsio", engineConfiguration->fsioAdc[0]); + tsOutputChannels->debugFloatField1 = getVoltage("fsio", engineConfiguration->fsioAdc[0] PASS_ENGINE_PARAMETER_SUFFIX); } break; case DBG_FSIO_EXPRESSION: @@ -991,7 +991,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->debugFloatField7 = (engineConfiguration->afr.hwChannel != EFI_ADC_NONE) ? getVoltageDivided("ego", engineConfiguration->afr.hwChannel PASS_ENGINE_PARAMETER_SUFFIX) : 0.0f; break; case DBG_ANALOG_INPUTS2: - tsOutputChannels->debugFloatField4 = getVoltage("debug", engineConfiguration->throttlePedalPositionAdcChannel); + tsOutputChannels->debugFloatField4 = getVoltage("debug", engineConfiguration->throttlePedalPositionAdcChannel PASS_ENGINE_PARAMETER_SUFFIX); break; case DBG_INSTANT_RPM: { diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index 86347f2b2f..8b455c2cfc 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -284,7 +284,7 @@ bool LECalculator::processElement(LEElement *element DECLARE_ENGINE_PARAMETER_SU // todo: implement code for digital inout!!! case LE_METHOD_FSIO_ANALOG_INPUT: // todo: start taking index parameter!!! - push(element->action, getVoltage("fsio", engineConfiguration->fsioAdc[0])); + push(element->action, getVoltage("fsio", engineConfiguration->fsioAdc[0] PASS_ENGINE_PARAMETER_SUFFIX)); break; case LE_METHOD_KNOCK: push(element->action, engine->knockCount); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 58c6519da0..fc321434f0 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -407,7 +407,7 @@ static void printAnalogChannelInfoExt(const char *name, adc_channel_e hwChannel, static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) { #if HAL_USE_ADC - printAnalogChannelInfoExt(name, hwChannel, getVoltage("print", hwChannel), engineConfiguration->analogInputDividerCoefficient); + printAnalogChannelInfoExt(name, hwChannel, getVoltage("print", hwChannel PASS_ENGINE_PARAMETER_SUFFIX), engineConfiguration->analogInputDividerCoefficient); #endif } @@ -449,7 +449,7 @@ static void printAnalogInfo(void) { printAnalogChannelInfo("A/C sw", engineConfiguration->acSwitchAdc); printAnalogChannelInfo("HIP9011", engineConfiguration->hipOutputChannel); - printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVoltage("vbatt", engineConfiguration->vbattAdcChannel), + printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVoltage("vbatt", engineConfiguration->vbattAdcChannel PASS_ENGINE_PARAMETER_SUFFIX), engineConfiguration->vbattDividerCoeff); } diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index 7b4d0915d6..d7065cb2af 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -232,7 +232,7 @@ static void printMAPInfo(void) { adc_channel_e mapAdc = engineConfiguration->map.sensor.hwChannel; static char pinNameBuffer[16]; - scheduleMsg(logger, "MAP %.2fv @%s", getVoltage("mapinfo", mapAdc), + scheduleMsg(logger, "MAP %.2fv @%s", getVoltage("mapinfo", mapAdc PASS_ENGINE_PARAMETER_SUFFIX), getPinNameByAdcChannel("map", mapAdc, pinNameBuffer)); if (engineConfiguration->map.sensor.type == MT_CUSTOM) { scheduleMsg(logger, "at %.2fv=%.2f at %.2fv=%.2f", diff --git a/firmware/controllers/sensors/thermistors.cpp b/firmware/controllers/sensors/thermistors.cpp index 31abf73e7f..27195401dc 100644 --- a/firmware/controllers/sensors/thermistors.cpp +++ b/firmware/controllers/sensors/thermistors.cpp @@ -83,7 +83,7 @@ temperature_t getTemperatureC(ThermistorConf *cfg, ThermistorMath *tm, bool useL tm->setConfig(&cfg->config); // implementation checks if configuration has changed or not DISPLAY_TEXT(Analog_MCU_reads); - tm->DISPLAY_FIELD(voltageMCU) = DISPLAY_TEXT(from_pin) getVoltage("term", cfg->DISPLAY_CONFIG(adcChannel)); + tm->DISPLAY_FIELD(voltageMCU) = DISPLAY_TEXT(from_pin) getVoltage("term", cfg->DISPLAY_CONFIG(adcChannel) PASS_ENGINE_PARAMETER_SUFFIX); DISPLAY_TEXT(EOL); DISPLAY_TEXT(Analog_ECU_reads); diff --git a/firmware/controllers/sensors/voltage.cpp b/firmware/controllers/sensors/voltage.cpp index 75e9d5cc8b..994aa9f31a 100644 --- a/firmware/controllers/sensors/voltage.cpp +++ b/firmware/controllers/sensors/voltage.cpp @@ -24,5 +24,5 @@ bool hasVBatt(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } float getVBatt(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - return getVoltage("vbatt", engineConfiguration->vbattAdcChannel) * engineConfiguration->vbattDividerCoeff; + return getVoltage("vbatt", engineConfiguration->vbattAdcChannel PASS_ENGINE_PARAMETER_SUFFIX) * engineConfiguration->vbattDividerCoeff; } diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index 35ecbc3c7f..e56f79ae54 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -50,7 +50,7 @@ EXTERN_ENGINE; // Board voltage, with divider coefficient accounted for float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { - return getVoltage(msg, hwChannel) * engineConfiguration->analogInputDividerCoefficient; + return getVoltage(msg, hwChannel PASS_ENGINE_PARAMETER_SUFFIX) * engineConfiguration->analogInputDividerCoefficient; } AdcDevice::AdcDevice(ADCConversionGroup* hwConfig) { diff --git a/firmware/hw_layer/adc_subscription.h b/firmware/hw_layer/adc_subscription.h index 51287e71ea..1da1f45be8 100644 --- a/firmware/hw_layer/adc_subscription.h +++ b/firmware/hw_layer/adc_subscription.h @@ -4,7 +4,6 @@ #include "global.h" #include "converter_sensor.h" -#include "rusefi_hw_enums.h" class AdcSubscription { public: diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index a969774829..1d95c1f322 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -111,7 +111,7 @@ static float getUr() { #if EFI_PROD_CODE if (!engineConfiguration->cj125isUrDivided) { // in case of directly connected Ur signal from CJ125 to the ADC pin of MCU - return getVoltage("cj125ur", CONFIG(cj125ur)); + return getVoltage("cj125ur", CONFIG(cj125ur) PASS_ENGINE_PARAMETER_SUFFIX); } else { // if a standard voltage division scheme with OpAmp is used return getVoltageDivided("cj125ur", CONFIG(cj125ur) PASS_ENGINE_PARAMETER_SUFFIX); diff --git a/unit_tests/boards.cpp b/unit_tests/boards.cpp index be3ff04d8d..fc3cdeee3f 100644 --- a/unit_tests/boards.cpp +++ b/unit_tests/boards.cpp @@ -23,11 +23,11 @@ float getVoltageDivided(const char *msg, adc_channel_e channel DECLARE_ENGINE_PA return 0; } -float getVoltage(const char *msg, int channel) { +float getVoltage(const char *msg, adc_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX) { return 0; } -int getAdcValue(const char *msg, int channel) { +int getAdcValue(const char *msg, adc_channel_e channel) { return 0; } diff --git a/unit_tests/boards.h b/unit_tests/boards.h index 61819c283f..fde5819c0f 100644 --- a/unit_tests/boards.h +++ b/unit_tests/boards.h @@ -13,7 +13,7 @@ #define ADC_CHANNEL_VREF 0 float getVoltageDivided(const char *msg, adc_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX); -float getVoltage(const char *msg, int channel); -int getAdcValue(const char *msg, int channel); +float getVoltage(const char *msg, adc_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX); +int getAdcValue(const char *msg, adc_channel_e channel); #endif /* BOARDS_H_ */