From a755a1e5b33452059f5429a046c619b600f8907a Mon Sep 17 00:00:00 2001 From: Ollo Date: Fri, 9 Dec 2022 23:47:01 +0100 Subject: [PATCH] Clear rgb buffer before updating it --- main.lua | 5 +++++ webserver.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 37c3082..f898542 100644 --- a/main.lua +++ b/main.lua @@ -145,6 +145,11 @@ function normalOperation() heapusage=nil alive = alive + 1 else + if (colorBg ~= nil) then + rgbBuffer:fill(string.byte(colorBg,1), string.byte(colorBg,2), string.byte(colorBg,3)) -- disable all LEDs + else + rgbBuffer:fill(0,0,0) -- disable all LEDs + end displayTime() alive = alive + 1 end diff --git a/webserver.lua b/webserver.lua index 006cd6c..e8ffd83 100644 --- a/webserver.lua +++ b/webserver.lua @@ -165,7 +165,7 @@ function startWebServer() sec, _ = rtctime.get() file.open(configFile.. ".new", "w+") file.write("-- Config\n" .. "station_cfg={}\nstation_cfg.ssid=\"" .. _POST.ssid .. "\"\nstation_cfg.pwd=\"" .. _POST.password .. "\"\nstation_cfg.save=false\nwifi.sta.config(station_cfg)\n") - file.write("sntpserverhostname=\"" .. _POST.sntpserver .. "\"\n" .. "timezoneoffset=\"" .. _POST.timezoneoffset .. "\"\n".. "inv46=" .. tostring(_POST.inv46) .. "\n" .. "dim=" .. tostring(_POST.dim) .. "\n") + file.write("sntpserverhostname=\"" .. _POST.sntpserver .. "\"\n" .. "timezoneoffset=\"" .. _POST.timezoneoffset .. "\"\n".. "inv46=on\n" .. "dim=" .. tostring(_POST.dim) .. "\n") if ( _POST.fcolor ~= nil) then -- color=string.char(_POST.green, _POST.red, _POST.blue)