Clear rgb buffer before updating it

This commit is contained in:
Ollo 2022-12-09 23:47:01 +01:00
parent 017aef74f6
commit a755a1e5b3
2 changed files with 6 additions and 1 deletions

View File

@ -145,6 +145,11 @@ function normalOperation()
heapusage=nil heapusage=nil
alive = alive + 1 alive = alive + 1
else 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() displayTime()
alive = alive + 1 alive = alive + 1
end end

View File

@ -165,7 +165,7 @@ function startWebServer()
sec, _ = rtctime.get() sec, _ = rtctime.get()
file.open(configFile.. ".new", "w+") 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("-- 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 if ( _POST.fcolor ~= nil) then
-- color=string.char(_POST.green, _POST.red, _POST.blue) -- color=string.char(_POST.green, _POST.red, _POST.blue)