From 7f254c6d1267ee2804d9b5b4837e49fdeee54ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sun, 27 Sep 2015 10:33:39 +0200 Subject: [PATCH] sys/xtimer: rename _ms_to_sec -> _us_to_sec to reflect actual functionality The function divides the argument by 1000000, (microsecond to seconds) --- sys/xtimer/xtimer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/xtimer/xtimer.c b/sys/xtimer/xtimer.c index 1cb2fd25c7..a03cb55bd9 100644 --- a/sys/xtimer/xtimer.c +++ b/sys/xtimer/xtimer.c @@ -155,16 +155,16 @@ void xtimer_set_wakeup64(xtimer_t *timer, uint64_t offset, kernel_pid_t pid) * This is to avoid using long integer division functions * the compiler otherwise links in. */ -static inline uint64_t _ms_to_sec(uint64_t ms) +static inline uint64_t _us_to_sec(uint64_t us) { - return (unsigned long long)(ms * 0x431bde83) >> (0x12 + 32); + return (unsigned long long)(us * 0x431bde83) >> (0x12 + 32); } void xtimer_now_timex(timex_t *out) { uint64_t now = xtimer_now64(); - out->seconds = _ms_to_sec(now); + out->seconds = _us_to_sec(now); out->microseconds = now - (out->seconds * SEC_IN_USEC); }