ADC progress

This commit is contained in:
rusefi 2020-09-21 06:10:25 -04:00
parent df551d77fb
commit c957541cf4
4 changed files with 10 additions and 25 deletions

View File

@ -6,8 +6,7 @@
* @author andreika <prometheus.pcb@gmail.com>
*/
#ifndef RUSEFI_HW_ENUMS_H_
#define RUSEFI_HW_ENUMS_H_
#pragma once
// todo: migrate/unify with pin_output_mode_e? rename? something is messy here
// this enum is currently only used for SPI pins
@ -298,7 +297,3 @@ typedef enum __attribute__ ((__packed__)) {
TEST_IAT_CHANNEL = 36,
#endif /* EFI_UNIT_TEST */
} adc_channel_e;
#define INCOMPATIBLE_CONFIG_CHANGE EFI_ADC_0
#endif /* RUSEFI_HW_ENUMS_H_ */

View File

@ -6,8 +6,7 @@
* @author andreika <prometheus.pcb@gmail.com>
*/
#ifndef RUSEFI_HW_ENUMS_H_
#define RUSEFI_HW_ENUMS_H_
#pragma once
// todo: migrate/unify with pin_output_mode_e? rename? something is messy here
// this enum is currently only used for SPI pins
@ -181,7 +180,3 @@ typedef enum __attribute__ ((__packed__)) {
// todo: bad choice of value since now we have ADC_CHANNEL_SENSOR and could end up with 17 and 18 also
EFI_ADC_ERROR = 17,
} adc_channel_e;
#define INCOMPATIBLE_CONFIG_CHANGE EFI_ADC_0
#endif /* RUSEFI_HW_ENUMS_H_ */

View File

@ -268,6 +268,3 @@ typedef enum __attribute__ ((__packed__)) {
// todo: bad choice of value since now we have ADC_CHANNEL_SENSOR and could end up with 17 and 18 also
EFI_ADC_ERROR = 17,
} adc_channel_e;
#define INCOMPATIBLE_CONFIG_CHANGE EFI_ADC_0

View File

@ -560,18 +560,16 @@ static void configureInputs(void) {
addChannel("IAT", engineConfiguration->iat.adcChannel, ADC_SLOW);
addChannel("AUX Temp 1", engineConfiguration->auxTempSensor1.adcChannel, ADC_SLOW);
addChannel("AUX Temp 2", engineConfiguration->auxTempSensor2.adcChannel, ADC_SLOW);
if (engineConfiguration->auxFastSensor1_adcChannel != INCOMPATIBLE_CONFIG_CHANGE) {
// allow EFI_ADC_0 next time we have an incompatible configuration change
addChannel("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel, ADC_FAST);
}
addChannel("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel, ADC_FAST);
addChannel("AFR", engineConfiguration->afr.hwChannel, ADC_SLOW);
addChannel("Oil Pressure", engineConfiguration->oilPressure.hwChannel, 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);
}
addChannel("HFP1", engineConfiguration->high_fuel_pressure_sensor_1, ADC_SLOW);
addChannel("HFP2", engineConfiguration->high_fuel_pressure_sensor_2, ADC_SLOW);
if (CONFIG(isCJ125Enabled)) {
addChannel("CJ125 UR", engineConfiguration->cj125ur, ADC_SLOW);