From: Olivier Matz Date: Tue, 8 Oct 2013 22:01:15 +0000 (+0200) Subject: force "rising" variable to be 0 or 1 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0d09451fdf8906a3ce1a9d0b1f3ecb475269a1cf;p=protos%2Frc_servos.git force "rising" variable to be 0 or 1 --- 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);