Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -93,7 +93,8 @@ int main(){ | ... | @@ -93,7 +93,8 @@ int main(){ |
93 | if (wiringPiISR(Keypad[2], INT_EDGE_FALLING, &reset) < 0) { | 93 | if (wiringPiISR(Keypad[2], INT_EDGE_FALLING, &reset) < 0) { |
94 | return 1; | 94 | return 1; |
95 | } | 95 | } |
96 | - if (state==0) { | 96 | + while (1) { |
97 | + if (state == 0) { | ||
97 | unsigned long prevtime = millis(); | 98 | unsigned long prevtime = millis(); |
98 | while (1) { | 99 | while (1) { |
99 | if (state > 0) break; | 100 | if (state > 0) break; |
... | @@ -107,7 +108,7 @@ int main(){ | ... | @@ -107,7 +108,7 @@ int main(){ |
107 | data[2] = (time % 1000) / 100; | 108 | data[2] = (time % 1000) / 100; |
108 | data[3] = (time / 1000) % 10; | 109 | data[3] = (time / 1000) % 10; |
109 | data[4] = (time / 10000) % 10; | 110 | data[4] = (time / 10000) % 10; |
110 | - data[5]=time / 100000 ; | 111 | + data[5] = time / 100000; |
111 | timer(); | 112 | timer(); |
112 | } | 113 | } |
113 | } | 114 | } |
... | @@ -117,5 +118,6 @@ int main(){ | ... | @@ -117,5 +118,6 @@ int main(){ |
117 | timer(); | 118 | timer(); |
118 | } | 119 | } |
119 | } | 120 | } |
121 | + } | ||
120 | return 0; | 122 | return 0; |
121 | } | 123 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment