refactoring: helper method

This commit is contained in:
rusefillc 2022-10-29 23:04:24 -04:00
parent ecec622f2d
commit 13c9de1c80
4 changed files with 12 additions and 7 deletions

View File

@ -14,6 +14,7 @@
#include "custom_engine.h"
#include "electronic_throttle_impl.h"
#include "hellen_meta.h"
#include "defaults.h"
static void setInjectorPins() {
engineConfiguration->injectionPins[0] = H176_LS_1; // 96 - INJ_1
@ -74,8 +75,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
engineConfiguration->throttlePedalPositionAdcChannel = H144_IN_PPS; // 34 In PPS1
engineConfiguration->throttlePedalPositionSecondAdcChannel = H144_IN_AUX2; // 35 In PPS2
// 34 In PPS1
// 35 In PPS2
setPPSInputs(H144_IN_PPS, H144_IN_AUX2);
engineConfiguration->throttlePedalUpVoltage = 0.4;
engineConfiguration->throttlePedalWOTVoltage = 2;

View File

@ -80,6 +80,7 @@
#include "dc_motor.h"
#include "dc_motors.h"
#include "pid_auto_tune.h"
#include "defaults.h"
#if defined(HAS_OS_ACCESS)
#error "Unexpected OS ACCESS HERE"
@ -1110,11 +1111,7 @@ void setProteusHitachiEtbDefaults() {
engineConfiguration->tps2_1AdcChannel = PROTEUS_IN_TPS2_1;
// EFI_ADC_0: "Analog Volt 5"
engineConfiguration->tps2_2AdcChannel = PROTEUS_IN_ANALOG_VOLT_5;
// EFI_ADC_1: "Analog Volt 6"
engineConfiguration->throttlePedalPositionAdcChannel = PROTEUS_IN_ANALOG_VOLT_6;
// EFI_ADC_2: "Analog Volt 7"
engineConfiguration->throttlePedalPositionSecondAdcChannel = PROTEUS_IN_PPS2;
setPPSInputs(PROTEUS_IN_ANALOG_VOLT_6, PROTEUS_IN_PPS2);
#endif // HW_PROTEUS
}

View File

@ -96,3 +96,8 @@ void setDefaultBaseEngine() {
setDefaultVrThresholds();
}
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2) {
engineConfiguration->throttlePedalPositionAdcChannel = pps1;
engineConfiguration->throttlePedalPositionSecondAdcChannel = pps2;
}

View File

@ -7,3 +7,4 @@ void setDefaultBaseEngine();
void setDefaultFuel();
void setDefaultIgnition();
void setDefaultCranking();
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2);