mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Fix #3682
Potential fix for #3682, declaration of `eeprom` moved to main chunk.
This commit is contained in:
parent
a181c38991
commit
d8c9015763
@ -1,9 +1,15 @@
|
||||
local component = require("component")
|
||||
local shell = require("shell")
|
||||
local fs = require("filesystem")
|
||||
local eeprom = component.eeprom
|
||||
|
||||
local args, options = shell.parse(...)
|
||||
|
||||
-- No funtion available to check if the EEPROM is read-only
|
||||
if not eeprom.setLabel(eeprom.getLabel()) then
|
||||
io.write("WARNING : read-only EEPROM, BIOS can't be flashed to it.\n\n")
|
||||
end
|
||||
|
||||
if #args < 1 and not options.l then
|
||||
io.write("Usage: flash [-qlr] [<bios.lua>] [label]\n")
|
||||
io.write(" q: quiet mode, don't ask questions.\n")
|
||||
@ -13,12 +19,10 @@ if #args < 1 and not options.l then
|
||||
end
|
||||
|
||||
local function printRom()
|
||||
local eeprom = component.eeprom
|
||||
io.write(eeprom.get())
|
||||
end
|
||||
|
||||
local function readRom()
|
||||
local eeprom = component.eeprom
|
||||
local fileName = shell.resolve(args[1])
|
||||
if not options.q then
|
||||
if fs.exists(fileName) then
|
||||
@ -53,8 +57,6 @@ local function writeRom()
|
||||
io.write("Beginning to flash EEPROM.\n")
|
||||
end
|
||||
|
||||
local eeprom = component.eeprom
|
||||
|
||||
if not options.q then
|
||||
io.write("Flashing EEPROM " .. eeprom.address .. ".\n")
|
||||
io.write("Please do NOT power down or restart your computer during this operation!\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user