default arguments are cool even while I might not even need it now
This commit is contained in:
parent
05a8a93028
commit
70945665e9
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue