Bläddra i källkod

Name global timers to prevent collision, ensure yo recipient file exists

etisab 10 år sedan
förälder
incheckning
c9a201ebed
1 ändrade filer med 26 tillägg och 6 borttagningar
  1. 26 6
      BUILD/init.lua

+ 26 - 6
BUILD/init.lua

@@ -1,6 +1,26 @@
-startupDelayTimer = 1
-print("3 second startup delay using timer " .. startupDelayTimer .. '...')
-tmr.alarm(startupDelayTimer, 3000, 0, function ()
-  print("Starting.")
-  dofile("interrupt.lua")
-end)
+DEBUG = true
+SETUP = false
+SETUP_TIMEOUT = 120000
+
+STARTUP_DELAY_TIMER = 0
+INTERRUPT_TIMER = 1
+INDEX_TIMER = 2
+SETUP_INACTIVITY_TIMER = 3
+WIFI_WAIT_TIMER = 4
+SUCCESS_SETUP_TIMER = 5
+
+print("3 second startup delay using timer " .. STARTUP_DELAY_TIMER .. '...')
+tmr.alarm(STARTUP_DELAY_TIMER, 3000, 0, function ()
+    print("Starting.")
+
+    -- yo recipient file must exist
+    yoRecipientExists = file.open('yorecipient.txt', 'r')
+    file.close()
+    if yoRecipientExists == nil then
+      file.open('yorecipient.txt', 'w+')
+      file.close()
+    end
+
+
+    dofile("interrupt.lua")
+  end)