From 5cc18dc0df7eb13c537ad46ba5f3411e0d396be4 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Fri, 26 Feb 2021 09:48:03 -0500 Subject: bare minimum init files --- init.lua | 17 +++-------------- main.lua | 20 +++----------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/init.lua b/init.lua index 9f1ca8b..c3287b8 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,5 @@ -dofile("local_config.lua") -dofile("config.lua") - -- Compile server code and remove original .lua files. --- This only happens the first time afer the .lua files are uploaded. +-- This only happens the first time after the .lua files are uploaded. local compileAndRemoveIfNeeded = function(f) if file.open(f) then file.close() @@ -14,16 +11,8 @@ local compileAndRemoveIfNeeded = function(f) end local serverFiles = { - 'httpserver.lua', - 'httpserver-b64decode.lua', - 'httpserver-basicauth.lua', - 'httpserver-conf.lua', - 'httpserver-connection.lua', - 'httpserver-error.lua', - 'httpserver-header.lua', - 'httpserver-request.lua', - 'httpserver-static.lua', - 'telnetserver.lua' + 'microwire.lua', + 'lmx2487lib.lua' } for i, f in ipairs(serverFiles) do compileAndRemoveIfNeeded(f) end diff --git a/main.lua b/main.lua index 9b6c6b9..3636958 100644 --- a/main.lua +++ b/main.lua @@ -1,19 +1,5 @@ -if local_config.relay_present then - -- Setup relay - dofile("relay_switch.lua")(relay_pin_default_setting) -end +dofile("microwire.lc") +dofile("lmx2487lib.lc") +collectgarbage() -if local_config.display_present and not local_config.relay_present then - -- display and relay use the same pin - -- so in the presence of relay display should be off to avoid sporadic runs - dofile("display_setup.lua") - --dofile("draw.lua") - dofile("update_display.lua") -end - -dofile("wifi_config.lua") -dofile("update_time.lua") ---dofile("update_weather.lua") - ---s=dofile("httpserver.lc")(80) -- cgit v1.2.3