]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
Tweak emulator
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Wed, 23 Aug 2017 02:58:26 +0000 (22:58 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Wed, 23 Aug 2017 02:59:03 +0000 (22:59 -0400)
linux-draw-morse.lua
linux-draw-xpm.lua
linux-draw.lua

index 87e24b46926eb7650d37ef4932a92e91d01c1485..62a7981724857cd9742a3a1d45a8386a7b7194b5 100644 (file)
@@ -1,4 +1,4 @@
-package.loaded["morse"] = dofile("morse/morse.lua")
+package.loaded["morse"] = dofile("morse/morse")
 
 local dit = 500 -- milliseconds
 
index 853fd45bd4826e7593b25ecbd0ca17f8aa4678d6..ef772a1199495b6ddf5fe57d7509fc7015be915d 100644 (file)
@@ -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
index e9cb1046753cb17b8c176a2a176169b2766b8808..22170f1ac09f1fe5945562b34521a939e10b0d85 100644 (file)
@@ -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")