mirror of https://github.com/rusefi/rusefi.git
maybe lua freezes proteus h7 after 7 seconds of run #3539
This commit is contained in:
parent
b2c2e7e0c1
commit
b3204da186
|
@ -874,10 +874,31 @@ void proteusLuaDemo(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
// ETB disable PD11
|
||||
engineConfiguration->etbIo[0].disablePin = GPIO_UNASSIGNED;
|
||||
|
||||
auto script = R"(
|
||||
/**
|
||||
controlIndex = 0
|
||||
directionIndex = 1
|
||||
|
||||
print('pid output ' .. output)
|
||||
print('')
|
||||
|
||||
|
||||
|
||||
local duty = (bias + output) / 100
|
||||
|
||||
-- isPositive = duty > 0;
|
||||
-- pwmValue = isPositive and duty or -duty
|
||||
-- setPwmDuty(controlIndex, pwmValue)
|
||||
|
||||
-- dirValue = isPositive and 1 or 0;
|
||||
-- setPwmDuty(directionIndex, dirValue)
|
||||
|
||||
-- print('pwm ' .. pwmValue .. ' dir ' .. dirValue)
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
auto script = R"(
|
||||
|
||||
startPwm(0, 800, 0.1)
|
||||
-- direction
|
||||
startPwm(1, 80, 1.0)
|
||||
|
@ -914,17 +935,6 @@ function onTick()
|
|||
print('pid output ' .. output)
|
||||
print('')
|
||||
|
||||
|
||||
local duty = (bias + output) / 100
|
||||
|
||||
-- isPositive = duty > 0;
|
||||
-- pwmValue = isPositive and duty or -duty
|
||||
-- setPwmDuty(controlIndex, pwmValue)
|
||||
|
||||
-- dirValue = isPositive and 1 or 0;
|
||||
-- setPwmDuty(directionIndex, dirValue)
|
||||
|
||||
-- print('pwm ' .. pwmValue .. ' dir ' .. dirValue)
|
||||
end
|
||||
)";
|
||||
strncpy(config->luaScript, script, efi::size(config->luaScript));
|
||||
|
|
Loading…
Reference in New Issue