Fork for marginal changes to UI library.
Dependents: Data-Management-Honka
Fork of UI by
Diff: UserInterface.cpp
- Revision:
- 6:be26def664d1
- Parent:
- 1:7795fb7ee3f3
- Child:
- 7:53de0bee308d
diff -r 7795fb7ee3f3 -r be26def664d1 UserInterface.cpp --- a/UserInterface.cpp Sat Feb 14 00:36:19 2015 +0000 +++ b/UserInterface.cpp Sun Apr 05 21:15:37 2015 +0000 @@ -23,7 +23,7 @@ //int buttonB_prev = 1; //char __xbeeBuffer[250]; //int _dataCnt=0; -int UI = 0; +UI_t UI = BUTTON_NONE; //float _time_sinceA, _time_sinceB; //time since the button was first pressed @@ -158,9 +158,9 @@ if((_time_pressA-_time_sinceA) >= _tRelease) { //button was released if(_time_pressA-_tRelease >= _tHold) { //if the button was held before released - UI = 3; //UI command is a held A button + UI = BUTTON_A_HOLD; } else { - UI = 1; //UI command is a pressed A button + UI = BUTTON_A_PRESS; } _buttonA = 1; //button A is released _time_pressA.stop(); //reset the button A timer @@ -168,9 +168,9 @@ } if(_time_pressB-_time_sinceB >= _tRelease) { //button was released if(_time_pressB-_tRelease >= _tHold) { //if the button was held before released - UI = 4; //UI command is a held B button + UI = BUTTON_B_HOLD; } else { - UI = 2; //UI command is a pressed B button + UI = BUTTON_B_PRESS; } _buttonB = 1; //button B is released _time_pressB.stop(); //reset the button B timer @@ -222,9 +222,9 @@ } if((time_pressA-_time_sinceA)>=tRelease) { //button was released if(time_pressA-tRelease>=tHold) { //if the button was held before released - UI=3; //UI command is a held A button + UI = BUTTON_A_HOLD; } else { - UI=1; //UI command is a pressed A button + UI = BUTTON_A_PRESS; } buttonA=1; //button A is released time_pressA.stop(); //reset the button A timer @@ -232,9 +232,9 @@ } if(time_pressB-_time_sinceB>=tRelease) { //button was released if(time_pressB-tRelease>=tHold) { //if the button was held before released - UI=4; //UI command is a held B button + UI = BUTTON_B_HOLD; } else { - UI=2; //UI command is a pressed B button + UI = BUTTON_B_PRESS; } buttonB=1; //button B is released time_pressB.stop(); //reset the button B timer