Handle uninitialized constants
This commit is contained in:
parent
b80a604b46
commit
4810985a54
7
main.lua
7
main.lua
@ -43,7 +43,10 @@ end
|
|||||||
|
|
||||||
function displayTime()
|
function displayTime()
|
||||||
sec, usec = rtctime.get()
|
sec, usec = rtctime.get()
|
||||||
|
-- Handle lazy programmer:
|
||||||
|
if (timezoneoffset == nil) then
|
||||||
|
timezoneoffset=0
|
||||||
|
end
|
||||||
time = getTime(sec, timezoneoffset)
|
time = getTime(sec, timezoneoffset)
|
||||||
print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second)
|
print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second)
|
||||||
words = display_timestat(time.hour, time.minute)
|
words = display_timestat(time.hour, time.minute)
|
||||||
@ -110,8 +113,8 @@ function normalOperation()
|
|||||||
tmr.alarm(2, 500, 0 ,function()
|
tmr.alarm(2, 500, 0 ,function()
|
||||||
syncTimeFromInternet()
|
syncTimeFromInternet()
|
||||||
end)
|
end)
|
||||||
print("Start webserver...")
|
|
||||||
tmr.alarm(3, 2000, 0 ,function()
|
tmr.alarm(3, 2000, 0 ,function()
|
||||||
|
print("Start webserver...")
|
||||||
mydofile("webserver")
|
mydofile("webserver")
|
||||||
startWebServer()
|
startWebServer()
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user