From a5628be3ca0e68edb9258b5f8f793a2c9968681c Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 22 Aug 2017 22:58:26 -0400 Subject: [PATCH] Tweak emulator --- linux-draw-morse.lua | 2 +- linux-draw-xpm.lua | 2 +- linux-draw.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-draw-morse.lua b/linux-draw-morse.lua index 87e24b4..62a7981 100644 --- a/linux-draw-morse.lua +++ b/linux-draw-morse.lua @@ -1,4 +1,4 @@ -package.loaded["morse"] = dofile("morse/morse.lua") +package.loaded["morse"] = dofile("morse/morse") local dit = 500 -- milliseconds diff --git a/linux-draw-xpm.lua b/linux-draw-xpm.lua index 853fd45..ef772a1 100644 --- a/linux-draw-xpm.lua +++ b/linux-draw-xpm.lua @@ -25,7 +25,7 @@ end local function drawfailsafe(t,fb,g,r,b) fb:fill(0,0,0) end function loaddrawfn(name) - local f = loadfile (string.format("examples/lamp/draw-%s.lua",name)) + local f = loadfile (string.format("draw-%s.lua",name)) local fn = f and f() if fn then return function(t,fb,g,r,b) fn(t,fb,g,r,b) end diff --git a/linux-draw.lua b/linux-draw.lua index e9cb104..22170f1 100644 --- a/linux-draw.lua +++ b/linux-draw.lua @@ -10,7 +10,7 @@ cq = require "cqueues" local cqs = require "cqueues.signal" cqc = cq.new() -package.loaded["fifo"] = dofile("fifo/fifo.lua") -- ick, but hey, it works! +package.loaded["fifo"] = require "fifo/fifo" function printerr(...) local s = "", i, v @@ -26,7 +26,7 @@ end -- laying around, and they might accumulate without bound. So we have a -- notion of which callback was registered last and the others turn into -- NOPs by comparing the current callback against the value we closed over. -tq = dofile("tq/tq.lua")(nil) +tq = require("tq/tq")(nil) tq.__emu_lastcb = 0 tq.now = function() return cq.monotime() * 1000000 end tq.arm = function(self,t,et) @@ -79,7 +79,7 @@ cqc:wrap(function() local line = io.read() -- XXX :( if line == nil or line == "" then return end printerr("line: " .. line) - dofile("examples/lamp/lamp-remote.lua")(line) + dofile("lamp-remote.lua")(line) end end) io.stdout:setvbuf("no") -- 2.50.1