verbose lua start PWM

This commit is contained in:
rusefillc 2024-02-27 16:34:14 -05:00
parent a4dcf3ac04
commit e0c0db8722
1 changed files with 7 additions and 1 deletions

View File

@ -277,12 +277,18 @@ static int lua_startPwm(lua_State* l) {
// clamp to 1..1000 hz, this line would turn 0hz on/off PWM into 1hz behind the scenes
freq = clampF(1, freq, 1000);
brain_pin_e pwmPin = engineConfiguration->luaOutputPins[p.idx];
startSimplePwmExt(
&p.pwm, "lua", &engine->executor,
engineConfiguration->luaOutputPins[p.idx], &enginePins.luaOutputPins[p.idx],
pwmPin, &enginePins.luaOutputPins[p.idx],
freq, duty
);
efiPrintf("LUA PWM on %s at %f initial duty",
hwPortname(pwmPin),
PERCENT_MULT * duty);
return 0;
}