Adapted Lua files to machine functions

This commit is contained in:
Alessandro Proto 2023-02-02 11:20:35 +01:00
parent 2544659d0c
commit 2ed070f7ab
4 changed files with 8 additions and 4 deletions

View file

@ -1,7 +1,8 @@
local timer = require("timer") local timer = require("timer")
local machine = require("machine")
print("Goodbye!") print("Goodbye!")
timer.sleep(1000) timer.sleep(1000)
os.shutdown(true) machine.reboot()

View file

@ -1,7 +1,8 @@
local timer = require("timer") local timer = require("timer")
local machine = require("machine")
print("Goodbye!") print("Goodbye!")
timer.sleep(1000) timer.sleep(1000)
os.shutdown(false) machine.shutdown()

View file

@ -1,5 +1,6 @@
local term = require("term") local term = require("term")
local colors = require("colors") local colors = require("colors")
local machine = require("machine")
term.setForeground(0x59c9ff) term.setForeground(0x59c9ff)
term.setBackground(colors.black) term.setBackground(colors.black)
@ -11,4 +12,4 @@ term.setPos(1, 2)
dofile("/bin/shell.lua") dofile("/bin/shell.lua")
os.shutdown(false) machine.shutdown()

View file

@ -2,6 +2,7 @@
local timer = require("timer") local timer = require("timer")
local gpu = require("gpu") local gpu = require("gpu")
local fs = require("fs") local fs = require("fs")
local machine = require("machine")
local bootSleep = 2000 local bootSleep = 2000
local bg = 0x0 local bg = 0x0
@ -72,7 +73,7 @@ local function setupScreen()
}, },
{ {
"Shutdown", "Shutdown",
os.shutdown, machine.shutdown,
} }
} }