small firmware bug

This commit is contained in:
2026-04-30 23:00:24 +03:00
parent 77f79dd17a
commit c0f5effd1a

View File

@@ -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