From 6315f8e48658c83228b35fc4657c133c3c3ee1b2 Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Fri, 10 Jun 2016 14:46:11 +0100 Subject: [PATCH] Fix function is_in_wrapped_range, the function where returning false when instead of true when begin <= val < end. The documentation was correct but not the code. --- hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c b/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c index 11aebbe148..abbe793a52 100644 --- a/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c +++ b/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c @@ -462,9 +462,9 @@ static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t va // return true if begin <= val < end if (begin < end) { if (begin <= val && val < end) { - return false; - } else { return true; + } else { + return false; } } else { // In this case end < begin because it has wrap around the limits