From: Olivier Matz Date: Thu, 23 May 2013 18:19:18 +0000 (+0200) Subject: fix button filter X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0a81f0c8301bf766f688cc80c00e32799831a8e9;p=beacon-tx-433.git fix button filter --- diff --git a/main.c b/main.c index 820cdc1..3bdb5d6 100644 --- 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;