From af7f6454bcad40fe66d5c6d54fb8e608f91040be Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 3 Feb 2019 01:14:19 -0500 Subject: [PATCH] Refactor Trigger System #635 --- firmware/controllers/system/pwm_generator_logic.cpp | 7 +++++-- firmware/controllers/system/pwm_generator_logic.h | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/system/pwm_generator_logic.cpp b/firmware/controllers/system/pwm_generator_logic.cpp index 8051b6e6db..74db237cf5 100644 --- a/firmware/controllers/system/pwm_generator_logic.cpp +++ b/firmware/controllers/system/pwm_generator_logic.cpp @@ -245,7 +245,7 @@ static void timerCallback(PwmConfig *state) { * Incoming parameters are potentially just values on current stack, so we have to copy * into our own permanent storage, right? */ -void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes, int waveCount, pin_state_t *const *pinStates) { +void copyPwmParameters(PwmConfig *state, int phaseCount, float const *switchTimes, int waveCount, pin_state_t *const *pinStates) { state->phaseCount = phaseCount; for (int phaseIndex = 0; phaseIndex < phaseCount; phaseIndex++) { @@ -267,7 +267,10 @@ void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes, int * this method also starts the timer cycle * See also startSimplePwm */ -void PwmConfig::weComplexInit(const char *msg, ExecutorInterface *executor, int phaseCount, float *switchTimes, int waveCount, +void PwmConfig::weComplexInit(const char *msg, ExecutorInterface *executor, + const int phaseCount, + float const *switchTimes, + const int waveCount, pin_state_t *const*pinStates, pwm_cycle_callback *pwmCycleCallback, pwm_gen_callback *stateChangeCallback) { this->executor = executor; diff --git a/firmware/controllers/system/pwm_generator_logic.h b/firmware/controllers/system/pwm_generator_logic.h index 7436d790c8..b1d99bb1b3 100644 --- a/firmware/controllers/system/pwm_generator_logic.h +++ b/firmware/controllers/system/pwm_generator_logic.h @@ -55,7 +55,7 @@ public: void weComplexInit(const char *msg, ExecutorInterface *executor, - int phaseCount, float *swithcTimes, int waveCount, pin_state_t *const*pinStates, + const int phaseCount, float const *swithcTimes, const int waveCount, pin_state_t *const*pinStates, pwm_cycle_callback *pwmCycleCallback, pwm_gen_callback *callback); @@ -139,7 +139,7 @@ void startSimplePwmExt(SimplePwm *state, brain_pin_e brainPin, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback); -void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes, +void copyPwmParameters(PwmConfig *state, int phaseCount, float const *switchTimes, int waveCount, pin_state_t *const *pinStates); #endif /* PWM_GENERATOR_LOGIC_H_ */