From 36442751b9603db5cd82e82c12284fd4f0b8cf27 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 12 Jun 2017 23:40:56 +0000 Subject: [PATCH] added some ocemu-related debug modules --- modules/debug/ocemu-display.lua | 7 +++++++ modules/debug/ocemu-heartbeat.lua | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 modules/debug/ocemu-display.lua create mode 100644 modules/debug/ocemu-heartbeat.lua diff --git a/modules/debug/ocemu-display.lua b/modules/debug/ocemu-display.lua new file mode 100644 index 0000000..ccc75f6 --- /dev/null +++ b/modules/debug/ocemu-display.lua @@ -0,0 +1,7 @@ +s("ocemu display server",function() + while true do + if ev[1] == "display" then + component.invoke(component.list("ocemu")(),"log",ev[2] or "") + end + end +end) diff --git a/modules/debug/ocemu-heartbeat.lua b/modules/debug/ocemu-heartbeat.lua new file mode 100644 index 0000000..1753748 --- /dev/null +++ b/modules/debug/ocemu-heartbeat.lua @@ -0,0 +1,9 @@ +_G.DEBUG=true +s("heartbeat",function() + while true do + if _G.DEBUG then + component.invoke(component.list("ocemu")(),"log","heartbeat:"..tostring(computer.uptime())) + end + C.yield() + end +end)