From 824f87c2d05d9ff3e0f28571baf95a732b5863f6 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 8 Dec 2020 04:52:49 -0500 Subject: [PATCH] basic hw in the loop - pwm self validation #2028 --- firmware/controllers/trigger/trigger_emulator_algo.cpp | 8 ++++++++ firmware/controllers/trigger/trigger_emulator_algo.h | 2 ++ firmware/hw_layer/hardware.cpp | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/firmware/controllers/trigger/trigger_emulator_algo.cpp b/firmware/controllers/trigger/trigger_emulator_algo.cpp index 1e454841c6..8a84dcdb86 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.cpp +++ b/firmware/controllers/trigger/trigger_emulator_algo.cpp @@ -216,4 +216,12 @@ void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) initTriggerEmulatorLogic(sharedLogger); } +void startTriggerEmulatorPins() { + +} + +void stopTriggerEmulatorPins() { + +} + #endif /* EFI_EMULATE_POSITION_SENSORS */ diff --git a/firmware/controllers/trigger/trigger_emulator_algo.h b/firmware/controllers/trigger/trigger_emulator_algo.h index 6c22182314..8038fe6991 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.h +++ b/firmware/controllers/trigger/trigger_emulator_algo.h @@ -14,6 +14,8 @@ class PwmConfig; class MultiChannelStateSequence; void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); +void startTriggerEmulatorPins(); +void stopTriggerEmulatorPins(); void setTriggerEmulatorRPM(int value DECLARE_ENGINE_PARAMETER_SUFFIX); void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration); diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 55bec4bc6e..35f8dcbb5e 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -50,6 +50,7 @@ #include "engine_configuration.h" #include "aux_pid.h" #include "perf_trace.h" +#include "trigger_emulator_algo.h" #include "boost_control.h" #include "software_knock.h" #if EFI_MC33816 @@ -354,6 +355,10 @@ void applyNewHardwareSettings(void) { stopLogicAnalyzerPins(); #endif /* EFI_LOGIC_ANALYZER */ +#if EFI_EMULATE_POSITION_SENSORS + stopTriggerEmulatorPins(); +#endif /* EFI_EMULATE_POSITION_SENSORS */ + #if EFI_AUX_PID stopAuxPins(); #endif /* EFI_AUX_PID */ @@ -431,6 +436,9 @@ void applyNewHardwareSettings(void) { #if EFI_BOOST_CONTROL startBoostPin(); #endif +#if EFI_EMULATE_POSITION_SENSORS + startTriggerEmulatorPins(); +#endif /* EFI_EMULATE_POSITION_SENSORS */ #if EFI_LOGIC_ANALYZER startLogicAnalyzerPins(); #endif /* EFI_LOGIC_ANALYZER */