Просмотр исходного кода

debounce timer increased, better formatting

etisab 10 лет назад
Родитель
Сommit
05d9216acc
2 измененных файлов с 7 добавлено и 7 удалено
  1. 3 3
      BUILD/init.lua
  2. 4 4
      BUILD/interrupt.lua

+ 3 - 3
BUILD/init.lua

@@ -1,6 +1,6 @@
 startupDelayTimer = 1
 print("3 second startup delay using timer " .. startupDelayTimer .. '...')
 tmr.alarm(startupDelayTimer, 3000, 0, function ()
-                                        print("Starting.")
-                                        dofile("interrupt.lua")
-                                      end)
+  print("Starting.")
+  dofile("interrupt.lua")
+end)

+ 4 - 4
BUILD/interrupt.lua

@@ -19,9 +19,9 @@ function shortOrLongPress()
   if level == 0 then -- button depressed
     debugMsg("LONG PRESS TIMER START")
     tmr.alarm(5, longPress, 0, function()
-                                 debugMsg("LONG PRESS")
-                                 dofile('wifiSetup.lua')
-                               end)
+      debugMsg("LONG PRESS")
+      dofile('wifiSetup.lua')
+    end)
   else -- button released
     debugMsg("SETUP STATUS " .. tostring(SETUP))
     tmr.stop(5)
@@ -34,7 +34,7 @@ end
 
 function debounce (func)
   local last = 0
-  local delay = 100000
+  local delay = 200000
 
   return function (...)
     local now = tmr.now()