refactor: streamline driver loading in main and startup scripts

This commit is contained in:
2025-06-14 12:39:46 -04:00
parent 2e257a7b1e
commit 5976b2c1c3
3 changed files with 4 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ local function addDriver(fileName)
local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/" local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
shell.execute("wget", baseRoute .. fullFile) shell.execute("wget", baseRoute .. fullFile)
sleep(1) sleep(1)
return require(fileName)
end end
return { addDriver = addDriver } return { addDriver = addDriver }

View File

@@ -1,8 +1,7 @@
local function run() local function run()
print("Running main loop") local kernel = require("kernel")
local tempDriver = require("temperature_monitor") local tempDrive = kernel.addDriver("temperature_monitor")
local monitor = peripheral.find("monitor") local monitor = peripheral.find("monitor")
while true do while true do
monitor.clear() monitor.clear()
monitor.setCursorPos(1,1) monitor.setCursorPos(1,1)

View File

@@ -1,7 +1,3 @@
local kernel = require("kernel") local main = kernel.addDriver("main")
kernel.addDriver("temperature_monitor")
kernel.addDriver("main")
sleep(5) sleep(5)
local main = require("main")
main.run() main.run()