refactoring
This commit is contained in:
parent
c8a17b9185
commit
c0750fcf2e
|
@ -247,13 +247,27 @@ static void initTemperatureCurve(float *bins, float *values, int size, float def
|
|||
}
|
||||
}
|
||||
|
||||
static void setDefaultFsioParameters(engine_configuration_s *engineConfiguration) {
|
||||
board_configuration_s *boardConfiguration = &engineConfiguration->bc;
|
||||
for (int i = 0; i < AUX_PID_COUNT; i++) {
|
||||
engineConfiguration->auxPidPins[i] = GPIO_UNASSIGNED;
|
||||
}
|
||||
for (int i = 0; i < FSIO_COMMAND_COUNT; i++) {
|
||||
boardConfiguration->fsioPins[i] = GPIO_UNASSIGNED;
|
||||
config->fsioFormulas[i][0] = 0;
|
||||
boardConfiguration->fsioDigitalInputs[i] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->fsioInputModes[i] = PI_DEFAULT;
|
||||
}
|
||||
for (int i = 0; i < FSIO_ADC_COUNT ; i++) {
|
||||
engineConfiguration->fsioAdc[i] = EFI_ADC_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) {
|
||||
memset(activeConfiguration, 0, sizeof(engine_configuration_s));
|
||||
board_configuration_s *boardConfiguration = &activeConfiguration->bc;
|
||||
|
||||
for (int i = 0; i < FSIO_ADC_COUNT ; i++) {
|
||||
activeConfiguration->fsioAdc[i] = EFI_ADC_NONE;
|
||||
}
|
||||
setDefaultFsioParameters(activeConfiguration);
|
||||
|
||||
disableLCD(boardConfiguration);
|
||||
|
||||
|
@ -516,18 +530,6 @@ static void setDefaultStepperIdleParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE)
|
|||
engineConfiguration->idleStepperTotalSteps = 150;
|
||||
}
|
||||
|
||||
static void setDefaultFsioParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
for (int i = 0; i < AUX_PID_COUNT; i++) {
|
||||
engineConfiguration->auxPidPins[i] = GPIO_UNASSIGNED;
|
||||
}
|
||||
for (int i = 0; i < FSIO_COMMAND_COUNT; i++) {
|
||||
boardConfiguration->fsioPins[i] = GPIO_UNASSIGNED;
|
||||
config->fsioFormulas[i][0] = 0;
|
||||
boardConfiguration->fsioDigitalInputs[i] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->fsioInputModes[i] = PI_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
static void setCanDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
boardConfiguration->canDeviceMode = CD_USE_CAN2;
|
||||
boardConfiguration->canTxPin = GPIOB_6;
|
||||
|
@ -858,8 +860,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
boardConfiguration->max31855_cs[i] = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
||||
setDefaultFsioParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->alternatorPwmFrequency = 300;
|
||||
|
||||
engineConfiguration->communicationPin = GPIOD_15; // blue LED on discovery
|
||||
|
|
Loading…
Reference in New Issue