diff --git a/init.lua b/init.lua index ab9be2b..f513b3d 100644 --- a/init.lua +++ b/init.lua @@ -21,10 +21,12 @@ function mydofile(mod) dofile( mod .. ".lua") elseif (file.open(mod .. "_diet.lua")) then dofile(mod .. "_diet.lua") + elseif (file.open(mod .. "_diet.lc")) then + dofile(mod .. "_diet.lc") elseif (file.open(mod)) then dofile(mod) else - print("Error: " .. mod) + print("NA: " .. mod) end end @@ -34,6 +36,19 @@ initTimer:register(5000, tmr.ALARM_SINGLE, function (t) t:unregister() initTimer=nil bootledtimer=nil + local modlist = { "timecore" , "displayword" } + for i,mod in pairs(modlist) do + if (file.open(mod .. "_diet.lua")) then + print(tostring(i) .. ". Compile " .. mod) + ws2812.write(string.char(0,0,0):rep(11*i)..string.char(128,0,0):rep(11)) + node.compile(mod .. "_diet.lua") + print("cleanup..") + file.remove(mod .. "_diet.lua") + node.restart() + return + end + end + if ( file.open("config.lua") ) then --- Normal operation print("Starting main") diff --git a/main.lua b/main.lua index ad5846a..5a45fcb 100644 --- a/main.lua +++ b/main.lua @@ -34,7 +34,7 @@ function displayTime() collectgarbage() mydofile("wordclock") if (wc ~= nil) then - local words = wc.timestat(time.hour, time.minute) + words = wc.timestat(time.hour, time.minute) if ((dim ~= nil) and (dim == "on")) then words.briPer=briPer if (words.briPer ~= nil and words.briPer < 3) then @@ -51,7 +51,7 @@ function displayTime() if (dw ~= nil) then --if lines 4 to 6 are inverted due to hardware-fuckup, unfuck it here local invertRows=false - if ((inv46 ~= nil) and (inv46 == "on")) then + if ((inv46 ~= nil) and (inv46 == "on")) then invertRows=true end local c = dw.countChars(words)