refactoring: helper method
This commit is contained in:
parent
fa3fed1ffd
commit
d6f6dd3a56
|
@ -74,7 +74,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->camInputs[0] = Gpio::Unassigned;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2;
|
||||
|
|
|
@ -101,7 +101,6 @@ static void setupDefaultSensorInputs() {
|
|||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps1_2AdcChannel = H144_IN_AUX1;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
setPPSInputs(H144_IN_PPS, H144_IN_AUX2);
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ static void setupDefaultSensorInputs() {
|
|||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps1_2AdcChannel = H144_IN_O2S2;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
setPPSInputs(H144_IN_PPS, H144_IN_AUX1);
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@ static void setupDefaultSensorInputs() {
|
|||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps1_2AdcChannel = H144_IN_AUX1;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
setPPSInputs(H144_IN_PPS, H144_IN_AUX2);
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->camInputs[0] = H144_IN_CAM;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_11;
|
||||
|
|
|
@ -71,8 +71,7 @@ static void setupDefaultSensorInputs() {
|
|||
// todo: this requires unit test change
|
||||
engineConfiguration->camInputs[1 * CAMS_PER_BANK] = H144_IN_D_AUX4;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps1_2AdcChannel = H144_IN_AUX1;
|
||||
setTPS1Inputs(H144_IN_TPS, H144_IN_AUX1);
|
||||
|
||||
setPPSInputs(H144_IN_PPS, EFI_ADC_14);
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||
|
|
|
@ -72,8 +72,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS; // 92 - TPS 1
|
||||
engineConfiguration->tps1_2AdcChannel = H144_IN_AUX1;
|
||||
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
// 34 In PPS1
|
||||
// 35 In PPS2
|
||||
setPPSInputs(H144_IN_PPS, H144_IN_AUX2);
|
||||
|
|
|
@ -75,7 +75,6 @@ static void setupDefaultSensorInputs() {
|
|||
|
||||
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;
|
||||
engineConfiguration->tps1_2AdcChannel = EFI_ADC_8;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = H144_IN_MAP1;
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2;
|
||||
|
|
|
@ -72,7 +72,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->camInputs[0] = Gpio::Unassigned;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_11;
|
||||
|
|
|
@ -73,7 +73,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->camInputs[0] = Gpio::A6;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_11;
|
||||
|
|
|
@ -82,7 +82,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->camInputs[0] = Gpio::A6;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_10;
|
||||
|
|
|
@ -67,7 +67,6 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->camInputs[0] = Gpio::Unassigned;
|
||||
|
||||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP3;
|
||||
|
|
|
@ -128,8 +128,6 @@ static void setupDefaultSensorInputs() {
|
|||
// vehicles without TPS or for first start without TPS one would have to turn in off
|
||||
// to avoid cranking corrections based on wrong TPS data
|
||||
engineConfiguration->tps1_1AdcChannel = MRE_IN_TPS;
|
||||
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
|
||||
|
||||
|
||||
engineConfiguration->map.sensor.hwChannel = MRE_IN_MAP;
|
||||
|
||||
|
|
|
@ -102,6 +102,11 @@ void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2) {
|
|||
engineConfiguration->throttlePedalPositionSecondAdcChannel = pps2;
|
||||
}
|
||||
|
||||
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2) {
|
||||
engineConfiguration->tps1_1AdcChannel = tps1;
|
||||
engineConfiguration->tps1_2AdcChannel = tps2;
|
||||
}
|
||||
|
||||
void setPPSCalibration(float primaryUp, float primaryDown, float secondaryUp, float secondaryDown) {
|
||||
engineConfiguration->throttlePedalUpVoltage = primaryUp;
|
||||
engineConfiguration->throttlePedalWOTVoltage = primaryDown;
|
||||
|
|
|
@ -8,4 +8,5 @@ void setDefaultFuel();
|
|||
void setDefaultIgnition();
|
||||
void setDefaultCranking();
|
||||
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2);
|
||||
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2);
|
||||
void setPPSCalibration(float primaryUp, float primaryDown, float secondaryUp, float secondaryDown);
|
||||
|
|
Loading…
Reference in New Issue