From 883adb671ca0854bce9942659d5e2ff08179a259 Mon Sep 17 00:00:00 2001 From: calculator Date: Tue, 16 Apr 2019 19:20:01 +0200 Subject: [PATCH] Unload all files --- webserver.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webserver.lua b/webserver.lua index 1575109..2aad4cf 100644 --- a/webserver.lua +++ b/webserver.lua @@ -140,13 +140,17 @@ function startWebServer() collectgarbage() -- Stop all 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)) -- Start Time after 1 minute tmr.alarm(6, 60000, 0 ,function() -- Start the time Thread tmr.alarm(1, 20000, 1 ,function() - displayTime() + dofile("main.lc") end) end) if (sendPage ~= nil) then