#474 run main reactor-plc loop clock when not networked

This commit is contained in:
Mikayla Fischler 2024-04-14 19:24:12 -04:00
parent 48b91ac808
commit 0b60dc9fa4
2 changed files with 12 additions and 15 deletions

View File

@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.7.8"
local R_PLC_VERSION = "v1.7.9"
local println = util.println
local println_ts = util.println_ts

View File

@ -71,22 +71,19 @@ function threads.thread__main(smem, init)
-- blink heartbeat indicator
databus.heartbeat()
-- core clock tick
if networked then
-- start next clock timer
loop_clock.start()
-- start next clock timer
loop_clock.start()
-- send updated data
if nic.is_connected() then
if plc_comms.is_linked() then
smem.q.mq_comms_tx.push_command(MQ__COMM_CMD.SEND_STATUS)
-- send updated data
if networked and nic.is_connected() then
if plc_comms.is_linked() then
smem.q.mq_comms_tx.push_command(MQ__COMM_CMD.SEND_STATUS)
else
if ticks_to_update == 0 then
plc_comms.send_link_req()
ticks_to_update = LINK_TICKS
else
if ticks_to_update == 0 then
plc_comms.send_link_req()
ticks_to_update = LINK_TICKS
else
ticks_to_update = ticks_to_update - 1
end
ticks_to_update = ticks_to_update - 1
end
end
end