Further RAM optimization

This commit is contained in:
Ollo 2021-02-07 17:57:58 +01:00
parent fbbecd0b6d
commit 08f310c149
2 changed files with 5 additions and 6 deletions

View File

@ -2,8 +2,8 @@ uart.setup(0, 115200, 8, 0, 1, 1 )
print("Autostart in 5 seconds...") print("Autostart in 5 seconds...")
ws2812.init() -- WS2812 LEDs initialized on GPIO2 ws2812.init() -- WS2812 LEDs initialized on GPIO2
MAXLEDS=110 local MAXLEDS=110
counter1=0 local counter1=0
ws2812.write(string.char(0,0,0):rep(114)) ws2812.write(string.char(0,0,0):rep(114))
local bootledtimer = tmr.create() local bootledtimer = tmr.create()
bootledtimer:register(500, tmr.ALARM_AUTO, function (t) bootledtimer:register(500, tmr.ALARM_AUTO, function (t)
@ -60,6 +60,8 @@ initTimer = tmr.create()
initTimer:register(5000, tmr.ALARM_SINGLE, function (t) initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
bootledtimer:unregister() bootledtimer:unregister()
t:unregister() t:unregister()
initTimer=nil
bootledtimer=nil
collectgarbage() collectgarbage()
if ( if (
(file.open("main.lua")) or (file.open("main.lua")) or
@ -87,9 +89,8 @@ initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
dofile("config.lua") dofile("config.lua")
normalOperation() normalOperation()
else else
mydofile("webserver")
-- Logic for inital setup -- Logic for inital setup
startSetupMode() mydofile("webserver")
end end
end end
end) end)

View File

@ -249,7 +249,6 @@ t=0
end) end)
end) end)
end end
function startSetupMode()
collectgarbage() collectgarbage()
wifi.setmode(wifi.SOFTAP) wifi.setmode(wifi.SOFTAP)
cfg={} cfg={}
@ -267,4 +266,3 @@ print("Waiting in access point >wordclock< for Clients")
print("Please visit 192.168.4.1") print("Please visit 192.168.4.1")
startWebServer() startWebServer()
collectgarbage() collectgarbage()
end