From 21ea057f700d1524aefeaac3a3c52023e22e2891 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 19 Apr 2023 16:51:16 -0400 Subject: [PATCH] reducing code duplication --- firmware/hw_layer/hardware.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index bf06280376..22aba00db8 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -342,8 +342,6 @@ void applyNewHardwareSettings() { startSmartCsPins(); #endif /* (BOARD_EXT_GPIOCHIPS > 0) */ - enginePins.startPins(); - #if EFI_AUX_SERIAL startAuxSerialPins(); #endif /* EFI_AUX_SERIAL */ @@ -464,8 +462,14 @@ void stopHardware() { /** * This method is invoked both on ECU start and configuration change + * At the moment we have too many system which handle ECU start and configuration change separately + * TODO: move move hardware code here */ void startHardware() { +#if EFI_ENGINE_CONTROL + enginePins.startPins(); +#endif /* EFI_ENGINE_CONTROL */ + #if (HAL_USE_PAL && EFI_JOYSTICK) startJoystickPins(); #endif /* HAL_USE_PAL && EFI_JOYSTICK */ @@ -546,10 +550,6 @@ void initHardware() { // output pins potentially depend on 'initSmartGpio' initOutputPins(); -#if EFI_ENGINE_CONTROL - enginePins.startPins(); -#endif /* EFI_ENGINE_CONTROL */ - #if EFI_MC33816 initMc33816(); #endif /* EFI_MC33816 */