#367 reworked ownership of tank data and facility instance to make more sense

This commit is contained in:
Mikayla Fischler
2024-08-20 21:32:54 -04:00
parent 4775639245
commit fc7441b2f6
6 changed files with 63 additions and 52 deletions

View File

@@ -16,6 +16,7 @@ local core = require("graphics.core")
local configure = require("supervisor.configure")
local databus = require("supervisor.databus")
local facility = require("supervisor.facility")
local renderer = require("supervisor.renderer")
local supervisor = require("supervisor.supervisor")
@@ -129,9 +130,12 @@ local function main()
println_ts = function (_) end
end
-- create facility and unit objects
local sv_facility = facility.new(config)
-- create network interface then setup comms
local nic = network.nic(modem)
local superv_comms = supervisor.comms(SUPERVISOR_VERSION, nic, fp_ok)
local superv_comms = supervisor.comms(SUPERVISOR_VERSION, nic, fp_ok, sv_facility)
-- base loop clock (6.67Hz, 3 ticks)
local MAIN_CLOCK = 0.15