default arguments are cool even while I might not even need it now

This commit is contained in:
Andrey 2023-09-05 16:01:34 -04:00
parent 05a8a93028
commit 70945665e9
2 changed files with 3 additions and 3 deletions

View File

@ -313,7 +313,7 @@ void PwmConfig::weComplexInit(const char *msg, ExecutorInterface *executor,
}
void startSimplePwm(SimplePwm *state, const char *msg, ExecutorInterface *executor,
OutputPin *output, float frequency, float dutyCycle) {
OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback) {
efiAssertVoid(ObdCode::CUSTOM_ERR_PWM_STATE_ASSERT, state != NULL, "state");
efiAssertVoid(ObdCode::CUSTOM_ERR_PWM_DUTY_ASSERT, dutyCycle >= 0 && dutyCycle <= PWM_MAX_DUTY, "dutyCycle");
if (frequency < 1) {
@ -330,7 +330,7 @@ void startSimplePwm(SimplePwm *state, const char *msg, ExecutorInterface *execut
state->setFrequency(frequency);
state->setSimplePwmDutyCycle(dutyCycle);
state->weComplexInit(msg, executor, &state->seq, NULL, applyPinState);
state->weComplexInit(msg, executor, &state->seq, NULL, callback);
}
void startSimplePwmExt(SimplePwm *state, const char *msg,

View File

@ -141,7 +141,7 @@ void applyPinState(int stateIndex, PwmConfig* state) /* pwm_gen_callback */;
void startSimplePwm(SimplePwm *state, const char *msg,
ExecutorInterface *executor,
OutputPin *output,
float frequency, float dutyCycle);
float frequency, float dutyCycle, pwm_gen_callback *callback = applyPinState);
/**
* initialize GPIO pin and start a one-channel software PWM driver.