if ie then pcall(ie) end
local gotmr = tmr.create()
-got = gotmr
local function goab()
OVL["nwfnet-diag"]()(true)
tcpserv:listen(23,function(k)
local telnetd = OVL["telnetd"]()
telnetd.on["conn"] = function(s)
- if gotmr then gotmr:stop() ; gotmr = nil end
+ if gotmr then gotmr:unregister() ; gotmr = nil end
s(string.format("NODE-%06X RECOVERY (auto reboot cancelled)",node.chipid()))
end
telnetd.server(k)
local function waitFLASH()
local function stop_()
gpio.mode(3,gpio.INPUT); gpio.trig(3)
- gotmr:stop(); got = nil; gotmr = nil
+ gotmr:unregister(); got = nil; gotmr = nil
stop = nil; go = nil
end
- function stop() stop_(); goab() end
+ function stop(full) stop_(); if not full then goab() end end
function go() print("Continuing boot..."); stop_(); goi2() end
print("Reset delay! Bounce GPIO3 low or type 'stop()' to stop autoboot, or 'go()' to go...")
gpio.mode(3,gpio.INT,gpio.PULLUP)
gotmr:alarm(8000,tmr.ALARM_SINGLE,go)
- gpio.trig(3,"low",function(_) print("Aborting..."); stop() end)
+ gpio.trig(3,"down",function(_) print("Aborting..."); stop() end)
end
local function bootPANIC()
print("Panic! Lingering for a minute with telnet console up; 'stop()' to persist...")