From 0fff745f669c4bf2d180acb34ca30a402892ac1f Mon Sep 17 00:00:00 2001 From: Hyungsin Date: Fri, 5 Jan 2018 15:07:30 -0800 Subject: [PATCH] xtimer_now: remove redundant substraction operation --- sys/include/xtimer/implementation.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/include/xtimer/implementation.h b/sys/include/xtimer/implementation.h index 15ff7529a4a6d..32fa8430ad8b9 100644 --- a/sys/include/xtimer/implementation.h +++ b/sys/include/xtimer/implementation.h @@ -134,12 +134,8 @@ static inline uint32_t _xtimer_now(void) uint32_t now_s; do { - now_s = _stimer_lltimer_now(); - if (now_s >= prev_s) { - diff_s = now_s - prev_s; - } else { - diff_s = (0xFFFFFFFF-prev_s) + now_s; - } + now_s = _stimer_lltimer_now(); + diff_s = now_s - prev_s; } while (diff_s < STIMER_HZ/XTIMER_HZ); return _xtimer_lltimer_mask(prev_x + (uint32_t)(diff_s*XTIMER_HZ/STIMER_HZ));