Handle overflow in bootloop

This commit is contained in:
Ollo 2021-02-05 21:50:02 +01:00
parent 89e215a609
commit 6699b70f14
2 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,9 @@ bootledtimer:register(500, tmr.ALARM_AUTO, function (t)
counter1=counter1+1 counter1=counter1+1
spaceLeds = math.max(MAXLEDS - (counter1*2), 0) spaceLeds = math.max(MAXLEDS - (counter1*2), 0)
ws2812.write(string.char(128,0,0):rep(counter1) .. string.char(0,0,0):rep(spaceLeds) .. string.char(0,0,64):rep(counter1)) ws2812.write(string.char(128,0,0):rep(counter1) .. string.char(0,0,0):rep(spaceLeds) .. string.char(0,0,64):rep(counter1))
if ((counter1*2) > 114) then
t:unregister()
end
end) end)
bootledtimer:start() bootledtimer:start()
@ -59,6 +62,7 @@ initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
(file.open("timecore.lua")) or (file.open("timecore.lua")) or
(file.open("wordclock.lua")) or (file.open("wordclock.lua")) or
(file.open("displayword.lua")) or (file.open("displayword.lua")) or
(file.open("websrv_diet.lua")) or
(file.open("mqtt.lua")) or (file.open("mqtt.lua")) or
(file.open("ds18b20.lua")) or (file.open("ds18b20.lua")) or
(file.open("telnet.lua")) (file.open("telnet.lua"))

View File

@ -26,7 +26,7 @@ if [ $# -eq 0 ]; then
fi fi
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
FILES="displayword.lua main.lua timecore.lua webpage.html webserver.lua telnet.lua wordclock.lua init.lua" FILES="displayword.lua main.lua timecore.lua webpage.html websrv_diet.lua telnet.lua wordclock.lua init.lua"
else else
FILES=$2 FILES=$2
fi fi