1
0
mirror of https://github.com/DigitalDevices/octonet.git synced 2023-10-10 11:36:52 +00:00

Temperature monitor

up to 4 sensors
display if there is no sensor available
fixed a race condition
This commit is contained in:
mvoelkel
2015-09-24 16:20:44 +02:00
parent 6e39d759fe
commit fb0aab674e
3 changed files with 65 additions and 28 deletions

View File

@@ -71,6 +71,13 @@ for i = 0,4,1 do
NumSensors = NumSensors + 1
end
end
local fh = io.open(LogFile,"w")
if fh then
fh:write(NumSensors..","..interval..","..fanstate.."\n")
fh:close()
end
if NumSensors == 0 then
return
end
@@ -116,7 +123,7 @@ while true do
TmpLogFile = os.tmpname()
local fh = io.open(TmpLogFile,"w")
fh = io.open(TmpLogFile,"w")
if fh then
fh:write(NumSensors..","..interval..","..fanstate.."\n")
@@ -135,4 +142,3 @@ while true do
end
collectgarbage()
end