fix button filter
authorOlivier Matz <zer0@droids-corp.org>
Thu, 23 May 2013 18:19:18 +0000 (20:19 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 23 May 2013 18:19:18 +0000 (20:19 +0200)
main.c

diff --git a/main.c b/main.c
index 820cdc1..3bdb5d6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -99,10 +99,11 @@ int main(void)
 
                /* filter button */
                button = 0;
-               if (BUTTON_IS_PRESSED() && button_filter < 10)
+               if (BUTTON_IS_PRESSED() && button_filter < 10) {
                        button_filter++;
-               else if (BUTTON_IS_PRESSED() && button_filter == 10)
-                       button = 1;
+                       if (button_filter == 10)
+                               button = 1;
+               }
                else if (!BUTTON_IS_PRESSED())
                        button_filter = 0;