diff --git a/armsrc/util.c b/armsrc/util.c index 9f42c0b08..0834e619d 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -268,8 +268,9 @@ int BUTTON_HELD(int ms) { int ticks = (48000 * (ms ? ms : 1000)) >> 10; // If we're not even pressed, forget about it! - if (BUTTON_PRESS() == false) + if (BUTTON_PRESS() == false) { return BUTTON_NO_CLICK; + } // Borrow a PWM unit for my real-time clock AT91C_BASE_PWMC->PWMC_ENA = PWM_CHANNEL(0); @@ -284,12 +285,14 @@ int BUTTON_HELD(int ms) { uint16_t now = AT91C_BASE_PWMC_CH0->PWMC_CCNTR; // As soon as our button let go, we didn't hold long enough - if (BUTTON_PRESS() == false) + if (BUTTON_PRESS() == false) { return BUTTON_SINGLE_CLICK; + } // Have we waited the full second? - else if (now == (uint16_t)(start + ticks)) + else if (now == (uint16_t)(start + ticks)) { return BUTTON_HOLD; + } WDT_HIT(); }