updated a bunch
This commit is contained in:
25
speaker_main.lua
Normal file
25
speaker_main.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
speaker = peripheral.find("speaker")
|
||||
speakerDriver = kernel.addDriver("speaker_driver")
|
||||
|
||||
local function startup()
|
||||
parallel.waitForAll(speakerDriver.startup)
|
||||
end
|
||||
|
||||
local function shutDown()
|
||||
parallel.waitForAll(speakerDriver.shutDown)
|
||||
end
|
||||
|
||||
local function runSafe()
|
||||
startup()
|
||||
end
|
||||
|
||||
local function run()
|
||||
local success, err = pcall(runSafe)
|
||||
if not success then
|
||||
os.reboot()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
return { run = run }
|
||||
Reference in New Issue
Block a user