Sfoglia il codice sorgente

start delay only on debug

etisab 10 anni fa
parent
commit
fe2b903a0f
2 ha cambiato i file con 16 aggiunte e 9 eliminazioni
  1. 16 2
      rebuild/init.lua
  2. 0 7
      rebuild/main.lua

+ 16 - 2
rebuild/init.lua

@@ -1,3 +1,17 @@
-tmr.alarm(0, 1000, 0, function()
+DEBUG = true
+
+function debug_message(message)
+  if DEBUG then
+    print(message)
+  end
+  --TODO: rolling last 10
+end
+
+if DEBUG then
+  debug_message('1 second startup delay on timer 0 ...')
+  tmr.alarm(0, 1000, 0, function()
+    dofile('main.lua')
+  end)
+else
   dofile('main.lua')
-end)
+end

+ 0 - 7
rebuild/main.lua

@@ -1,13 +1,6 @@
-DEBUG = true
 TIMERS = {
   interrupt = 1
 }
-function debug_message(message)
-  if DEBUG then
-    print(message)
-  end
-  --TODO: rolling last 10
-end
 
 local yo = require('yo')
 local server = require('server')