From b239c3d0768c00be44f423609f705dcc96421a5b Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Fri, 24 Jan 2020 22:55:10 +0000 Subject: [PATCH] lamp-touch: also scan LFS And add a note chastising past-me. --- lamp-touch.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lamp-touch.lua b/lamp-touch.lua index 4348848..951ce95 100644 --- a/lamp-touch.lua +++ b/lamp-touch.lua @@ -3,6 +3,9 @@ -- globals asserted: touchcolor, touchlastfn -- -- assumptions: gpio.trig(6) is the right thing to do for touch IRQs +-- +-- XXX this is a steaming pile; we should be taking and manipulating a state object +-- and should speak with the outside world via callbacks rather than holographically like this local touchfb = ws2812.newBuffer(32,3) local touch_fini = nil @@ -23,6 +26,11 @@ for k,v in pairs(file.list()) do local ix, _, meth = k:find("^draw%-(%w+)%.lc$") if ix then touchfns[#touchfns+1] = meth end end +local ut, fa, ma, sz, t = node.flashindex() +if t then for k,v in ipairs(t) do + local ix, _, meth = k:find("^draw%-(%w+)$") + if ix then touchfns[#touchfns+1] = meth end +end end table.sort(touchfns) for k,v in ipairs(touchfns) do if v == touchlastfn then touchfnix = k end end -- 2.50.1