From 0d09451fdf8906a3ce1a9d0b1f3ecb475269a1cf Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Wed, 9 Oct 2013 00:01:15 +0200 Subject: [PATCH] force "rising" variable to be 0 or 1 --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 923a8ea..67661d6 100644 --- a/main.c +++ b/main.c @@ -177,7 +177,7 @@ static void poll_input_capture(void) icp = ICR1; sei(); - rising = TCCR1B & _BV(ICES1); + rising = !!(TCCR1B & _BV(ICES1)); /* change the edge type */ TCCR1B ^= _BV(ICES1); -- 2.39.5