From 18da5e7e3beefdc78337e94d185445e46151c701 Mon Sep 17 00:00:00 2001 From: ollo Date: Thu, 18 Apr 2019 20:28:57 +0200 Subject: [PATCH] Automatic compile software after upgrade --- init.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 54c20bf..18d711f 100644 --- a/init.lua +++ b/init.lua @@ -11,8 +11,9 @@ tmr.alarm(2, 85, 1, function() ws2812.write(string.char(128,0,0):rep(counter1) .. string.char(0,0,0):rep(spaceLeds) .. string.char(0,0,64):rep(counter1)) end) -local blacklistfile="init.lua config.lua config.lua.new" +local blacklistfile="init.lua config.lua config.lua.new webpage.html" function recompileAll() + for i=0,5 do tmr.stop(i) end -- compile all files l = file.list(); for k,_ in pairs(l) do @@ -43,7 +44,14 @@ end tmr.alarm(1, 5000, 0, function() tmr.stop(2) - if (file.open("main.lua")) then + if ( + (file.open("main.lua")) or + (file.open("timecore.lua")) or + (file.open("wordclock.lua")) or + (file.open("displayword.lua")) or + (file.open("webserver.lua")) + ) then + ws2812.write(string.char(0,0,0):rep(4) .. string.char(128,0,0) .. string.char(0,0,0) ..string.char(128,0,0) .. string.char(0,0,0):rep(21) .. string.char(0,0,0):rep(30) .. string.char(128,0,0) .. string.char(0,0,0):rep(80)) recompileAll() print("Rebooting ...") -- reboot repairs everything