Browse Source

removed delays in buttonFocus() and EvtResetButtonContext()

trying to find a bug causing the teensy to freeze
Etienne Landon 7 years ago
parent
commit
59375b12f6
1 changed files with 7 additions and 8 deletions
  1. 7 8
      eventually.ino

+ 7 - 8
eventually.ino

@@ -60,23 +60,22 @@ void tlcWrite(){
 }
 
 void buttonFocus(int index) {
+
+  btnFile.close();
+  //delay(50);
+  
   currentButton = index ;
   //Serial.println(currentButton);
   //turn off all leds but currentButton one
   for (int i ; i < sizeof(ledState)/sizeof(uint32_t) ; i++) {
-
     if (i == currentButton ) { 
       ledState[11-i] = 10000 ; //65536 max
     }
     else { ledState[11-i] =  50 ; }
     tlcWrite();
-  }
-  
-  
-  
+  } 
   //et après ya plein de trucs à faire
-  btnFile.close();
-  delay(50);
+  
   String file = "button";
   file+=index ;
   file+=".txt";
@@ -191,7 +190,7 @@ bool button9(){
 void EvtResetButtonContext () {
   Serial.println("Resetting event context");
   mgr.resetContext();
-  delay (50);
+  //delay (50);
   // button listeners
   mgr.addListener(new EvtPinListener(BUTTON_PIN[0], (EvtAction)button0));
   mgr.addListener(new EvtPinListener(BUTTON_PIN[1], (EvtAction)button1));