From 08f310c149fa4b89e3aeb6bc07cedf867b430cef Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 7 Feb 2021 17:57:58 +0100 Subject: [PATCH] Further RAM optimization --- init.lua | 9 +++++---- webserver_diet.lua | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 69e5349..2dc59f0 100644 --- a/init.lua +++ b/init.lua @@ -2,8 +2,8 @@ uart.setup(0, 115200, 8, 0, 1, 1 ) print("Autostart in 5 seconds...") ws2812.init() -- WS2812 LEDs initialized on GPIO2 -MAXLEDS=110 -counter1=0 +local MAXLEDS=110 +local counter1=0 ws2812.write(string.char(0,0,0):rep(114)) local bootledtimer = tmr.create() bootledtimer:register(500, tmr.ALARM_AUTO, function (t) @@ -60,6 +60,8 @@ initTimer = tmr.create() initTimer:register(5000, tmr.ALARM_SINGLE, function (t) bootledtimer:unregister() t:unregister() + initTimer=nil + bootledtimer=nil collectgarbage() if ( (file.open("main.lua")) or @@ -87,9 +89,8 @@ initTimer:register(5000, tmr.ALARM_SINGLE, function (t) dofile("config.lua") normalOperation() else - mydofile("webserver") -- Logic for inital setup - startSetupMode() + mydofile("webserver") end end end) diff --git a/webserver_diet.lua b/webserver_diet.lua index 1456b1b..df80b0a 100644 --- a/webserver_diet.lua +++ b/webserver_diet.lua @@ -249,7 +249,6 @@ t=0 end) end) end -function startSetupMode() collectgarbage() wifi.setmode(wifi.SOFTAP) cfg={} @@ -267,4 +266,3 @@ print("Waiting in access point >wordclock< for Clients") print("Please visit 192.168.4.1") startWebServer() collectgarbage() -end