[fsync] add an enable option to each sensor in the uci file
This commit is contained in:
parent
cf5af8ec0b
commit
688df77ffa
|
@ -21,6 +21,7 @@ config sensor 1
|
||||||
list port 1
|
list port 1
|
||||||
option voltage 230
|
option voltage 230
|
||||||
option current 50
|
option current 50
|
||||||
|
option enable 1
|
||||||
|
|
||||||
config sensor 2
|
config sensor 2
|
||||||
option id 0123456789abcdef0123456789abcde2
|
option id 0123456789abcdef0123456789abcde2
|
||||||
|
@ -28,6 +29,7 @@ config sensor 2
|
||||||
list port 2
|
list port 2
|
||||||
option voltage 230
|
option voltage 230
|
||||||
option current 50
|
option current 50
|
||||||
|
option enable 1
|
||||||
|
|
||||||
config sensor 3
|
config sensor 3
|
||||||
option id 0123456789abcdef0123456789abcde3
|
option id 0123456789abcdef0123456789abcde3
|
||||||
|
@ -35,19 +37,23 @@ config sensor 3
|
||||||
list port 3
|
list port 3
|
||||||
option voltage 230
|
option voltage 230
|
||||||
option current 50
|
option current 50
|
||||||
|
option enable 1
|
||||||
|
|
||||||
config sensor 4
|
config sensor 4
|
||||||
option id 0123456789abcdef0123456789abcde4
|
option id 0123456789abcdef0123456789abcde4
|
||||||
option type pulse
|
option type pulse
|
||||||
list port 4
|
list port 4
|
||||||
option constant 1
|
option constant 1
|
||||||
|
option enable 1
|
||||||
|
|
||||||
config sensor 5
|
config sensor 5
|
||||||
option id 0123456789abcdef0123456789abcde5
|
option id 0123456789abcdef0123456789abcde5
|
||||||
option type pulse
|
option type pulse
|
||||||
list port 5
|
list port 5
|
||||||
option constant 1
|
option constant 1
|
||||||
|
option enable 1
|
||||||
|
|
||||||
config sensor 6
|
config sensor 6
|
||||||
option type uart
|
option type uart
|
||||||
list port 6
|
list port 6
|
||||||
|
option enable 1
|
||||||
|
|
|
@ -199,7 +199,7 @@ end
|
||||||
|
|
||||||
-- enable configured ports
|
-- enable configured ports
|
||||||
for i = 1, MAX_SENSORS do
|
for i = 1, MAX_SENSORS do
|
||||||
if flukso[tostring(i)] ~= nil then
|
if flukso[tostring(i)] ~= nil and flukso[tostring(i)].enable == '1' then
|
||||||
local ports = flukso[tostring(i)].port or {}
|
local ports = flukso[tostring(i)].port or {}
|
||||||
|
|
||||||
for j = 1, #ports do
|
for j = 1, #ports do
|
||||||
|
|
Loading…
Reference in New Issue