From 79bbbc8f457ec83f7c4965f6d5e2879aa01b52d9 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 25 May 2019 17:18:16 -0400 Subject: [PATCH] MC33816 integraion #784 --- firmware/controllers/algo/engine_configuration.cpp | 2 ++ firmware/controllers/algo/rusefi_enums.h | 2 ++ firmware/hw_layer/adc_inputs.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 9ab4dba761..95ba24976a 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -349,6 +349,8 @@ void prepareVoidConfiguration(engine_configuration_s *engineConfiguration) { engineConfiguration->fuelLevelSensor = EFI_ADC_NONE; engineConfiguration->hipOutputChannel = EFI_ADC_NONE; engineConfiguration->afr.hwChannel = EFI_ADC_NONE; + engineConfiguration->high_fuel_pressure_sensor_1 = EFI_ADC_NONE; + engineConfiguration->high_fuel_pressure_sensor_2 = EFI_ADC_NONE; boardConfiguration->idle.stepperDirectionPin = GPIO_UNASSIGNED; engineConfiguration->stepperDirectionPinMode = OM_DEFAULT; diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 42a88b7210..861e6d8c9a 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -609,6 +609,8 @@ typedef enum __attribute__ ((__packed__)) { #endif } adc_channel_e; +#define INCOMPATIBLE_CONFIG_CHANGE EFI_ADC_0 + typedef enum { MS_AUTO = 0, MS_ALWAYS = 1, diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index 8c8101a0dc..86c9f63d30 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -499,8 +499,10 @@ static void configureInputs(void) { addChannel("AFR", engineConfiguration->afr.hwChannel, ADC_SLOW); addChannel("OilP", engineConfiguration->oilPressure.hwChannel, ADC_SLOW); addChannel("AC", engineConfiguration->acSwitchAdc, ADC_SLOW); - addChannel("HFP1", engineConfiguration->high_fuel_pressure_sensor_1, ADC_SLOW); - addChannel("HFP2", engineConfiguration->high_fuel_pressure_sensor_2, ADC_SLOW); + if (engineConfiguration->high_fuel_pressure_sensor_1 != INCOMPATIBLE_CONFIG_CHANGE) + addChannel("HFP1", engineConfiguration->high_fuel_pressure_sensor_1, ADC_SLOW); + if (engineConfiguration->high_fuel_pressure_sensor_2 != INCOMPATIBLE_CONFIG_CHANGE) + addChannel("HFP2", engineConfiguration->high_fuel_pressure_sensor_2, ADC_SLOW); if (CONFIGB(isCJ125Enabled)) { addChannel("cj125ur", engineConfiguration->cj125ur, ADC_SLOW);