From 4d095d4844f78eaef2e53f311c3bed18516aa90e Mon Sep 17 00:00:00 2001 From: rusefi Date: Wed, 30 Oct 2019 20:51:20 -0400 Subject: [PATCH] 60/2 VW trigger has running issue on 19/10/19 snapshot fix #986 --- firmware/controllers/actuators/idle_thread.cpp | 5 +++++ firmware/controllers/algo/engine_configuration.cpp | 2 ++ firmware/controllers/engine_controller.cpp | 2 +- firmware/hw_layer/hardware.cpp | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 6b73f7b181..00a5ca1820 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -581,6 +581,11 @@ void startIdleThread(Logging*sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { idlePid.initPidClass(&engineConfiguration->idleRpmPid); +#if ! EFI_UNIT_TEST + // todo: we still have to explicitly init all hardware on start in addition to handling configuration change via + // 'applyNewHardwareSettings' todo: maybe unify these two use-cases? + initIdleHardware(PASS_ENGINE_PARAMETER_SIGNATURE); +#endif /* EFI_UNIT_TEST */ DISPLAY_STATE(Engine) DISPLAY_TEXT(Idle_State); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 24d47a7899..f1e4c7571c 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -159,6 +159,8 @@ extern LoggingWithStorage sharedLogger; /** * this is the top-level method which should be called in case of any changes to engine configuration * online tuning of most values in the maps does not count as configuration change, but 'Burn' command does + * + * this method is NOT currently invoked on ECU start - actual user input has to happen! */ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ENGINE(globalConfigurationVersion++); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 6dfaeec9ab..e91b3db91f 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -839,6 +839,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20191029; + return 20191030; } #endif /* EFI_UNIT_TEST */ diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 67799d32e2..872430abde 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -268,6 +268,10 @@ void stopSpi(spi_device_e device) { #endif /* HAL_USE_SPI */ } +/** + * this method is NOT currently invoked on ECU start + * todo: maybe start invoking this method on ECU start so that peripheral start-up initialization and restart are unified? + */ void applyNewHardwareSettings(void) { // all 'stop' methods need to go before we begin starting pins