small firmware bug
This commit is contained in:
@@ -7,20 +7,20 @@
|
|||||||
os.exit = nil
|
os.exit = nil
|
||||||
os.execute = nil
|
os.execute = nil
|
||||||
|
|
||||||
local sysyieldobj = "__SYSYIELD__"
|
local sysyieldobj = {}
|
||||||
local coroutine = coroutine
|
local coroutine = coroutine
|
||||||
|
|
||||||
local function sysyield()
|
local resume, yield = coroutine.resume, coroutine.yield
|
||||||
coroutine.yield(sysyieldobj)
|
|
||||||
end
|
|
||||||
|
|
||||||
local resume = coroutine.resume
|
local function sysyield()
|
||||||
|
yield(sysyieldobj)
|
||||||
|
end
|
||||||
|
|
||||||
function coroutine.resume(co, ...)
|
function coroutine.resume(co, ...)
|
||||||
while true do
|
while true do
|
||||||
local t = {resume(co, ...)}
|
local t = {resume(co, ...)}
|
||||||
if t[1] and rawequal(t[2], sysyieldobj) then
|
if t[1] and rawequal(t[2], sysyieldobj) then
|
||||||
coroutine.yield(sysyieldobj)
|
yield(sysyieldobj)
|
||||||
else
|
else
|
||||||
return table.unpack(t)
|
return table.unpack(t)
|
||||||
end
|
end
|
||||||
@@ -248,7 +248,7 @@ if os.getenv("NN_REPL") == "1" then
|
|||||||
f, err = load(l, "=repl")
|
f, err = load(l, "=repl")
|
||||||
if f then f() else print(err) end
|
if f then f() else print(err) end
|
||||||
end
|
end
|
||||||
coroutine.yield()
|
yield()
|
||||||
end
|
end
|
||||||
io.write("\n")
|
io.write("\n")
|
||||||
print("exiting repl")
|
print("exiting repl")
|
||||||
@@ -282,5 +282,5 @@ while true do
|
|||||||
end
|
end
|
||||||
if coroutine.status(thread) == "dead" then break end
|
if coroutine.status(thread) == "dead" then break end
|
||||||
end
|
end
|
||||||
coroutine.yield()
|
yield()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user