Skip to content

Commit 6315f8e

Browse files
committed
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.
1 parent 9714a0e commit 6315f8e

File tree

1 file changed

+2
-2
lines changed
  • hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822

1 file changed

+2
-2
lines changed

hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t va
462462
// return true if begin <= val < end
463463
if (begin < end) {
464464
if (begin <= val && val < end) {
465-
return false;
466-
} else {
467465
return true;
466+
} else {
467+
return false;
468468
}
469469
} else {
470470
// In this case end < begin because it has wrap around the limits

0 commit comments

Comments
 (0)