Unload all files

This commit is contained in:
calculator 2019-04-16 19:20:01 +02:00
parent e03ecf97b6
commit 883adb671c

View File

@ -140,13 +140,17 @@ function startWebServer()
collectgarbage() collectgarbage()
-- Stop all -- Stop all
for i=0,5 do tmr.stop(i) end for i=0,5 do tmr.stop(i) end
-- unload all other modules
package.loaded['displayword.lc']=nil
package.loaded['main.lc']=nil
package.loaded['wordclock']=nil
collectgarbage()
ws2812.write(string.char(0,0,0):rep(56) .. color:rep(2) .. string.char(0,0,0):rep(4) .. color:rep(2) .. string.char(0,0,0):rep(48)) ws2812.write(string.char(0,0,0):rep(56) .. color:rep(2) .. string.char(0,0,0):rep(4) .. color:rep(2) .. string.char(0,0,0):rep(48))
-- Start Time after 1 minute -- Start Time after 1 minute
tmr.alarm(6, 60000, 0 ,function() tmr.alarm(6, 60000, 0 ,function()
-- Start the time Thread -- Start the time Thread
tmr.alarm(1, 20000, 1 ,function() tmr.alarm(1, 20000, 1 ,function()
displayTime() dofile("main.lc")
end) end)
end) end)
if (sendPage ~= nil) then if (sendPage ~= nil) then