UI library

Dependents:   201_test-UI 200_yotsuba_21

Files at this revision

API Documentation at this revision

Comitter:
piroro4560
Date:
Fri Mar 05 05:02:49 2021 +0000
Parent:
2:a5e8e6156172
Commit message:
ok

Changed in this revision

ui.cpp Show annotated file Show diff for this revision Revisions of this file
ui.h Show annotated file Show diff for this revision Revisions of this file
diff -r a5e8e6156172 -r 1f322deb75d8 ui.cpp
--- a/ui.cpp	Thu Mar 04 11:38:44 2021 +0000
+++ b/ui.cpp	Fri Mar 05 05:02:49 2021 +0000
@@ -23,20 +23,23 @@
     for(int i = 0; i < 4; i++){
         if((b0 > (2*i + 3)) && (b0 < (2*i + 5))) b[i] = 1;
         else b[i] = 0;
+        if(b[i] && (!b_[i])) flag[i] = 1;
+        else flag[i] = 0;
     }
+    
     if (mode == 0) {
-        if(b[0] && (!b_[0])){
+        if(flag[0]){
             team = !team;
         }
-        if(b[1] && (!b_[1])){
+        if(flag[1]){
             ++algorithm %= 5;
         }
-    }
-    if(b[2] && (!b_[2])){
-        ++displayst %= 6;
-    }
-    if(b[3] && (!b_[3])){
-        start = !start;
+        if(flag[2]){
+            ++displayst %= 6;
+        }
+        if(flag[3]){
+            start = !start;
+        }
     }
     for(int i = 0; i < 4; i++) b_[i] = b[i];
     mode = (4*!tgl1)+(2*!tgl2)+(!tgl3);
diff -r a5e8e6156172 -r 1f322deb75d8 ui.h
--- a/ui.h	Thu Mar 04 11:38:44 2021 +0000
+++ b/ui.h	Fri Mar 05 05:02:49 2021 +0000
@@ -41,7 +41,7 @@
     mainに入れよう
     */
     uint8_t team, algorithm, displayst, start, mode;
-    uint8_t b[4], b_[4], st[4], b0;
+    uint8_t b[4], b_[4], flag[4], st[4], b0;
     /*
     team      -> 0:yellow  1:blue
     algorithm -> 0:offence  1:deffence  2:kicktest  3:displayonly  4:display & omuni