From a4ba6c12bcfcb96e99eca945c93aa966c591582a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.nohlgard@eistec.se>
Date: Tue, 10 Oct 2017 12:13:25 +0200
Subject: [PATCH] xtimer: Set XTIMER_SHIFT to 0 if underlying timer is 32768 Hz

---
 sys/include/xtimer.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sys/include/xtimer.h b/sys/include/xtimer.h
index e2a3d52cc3..616e4a60e6 100644
--- a/sys/include/xtimer.h
+++ b/sys/include/xtimer.h
@@ -579,7 +579,11 @@ void xtimer_set_timeout_flag(xtimer_t *t, uint32_t timeout);
 #endif
 
 #ifndef XTIMER_SHIFT
-#if (XTIMER_HZ == XTIMER_HZ_BASE)
+#if (XTIMER_HZ == 32768ul)
+/* No shift necessary, the conversion is not a power of two and is handled by
+ * functions in tick_conversion.h */
+#define XTIMER_SHIFT (0)
+#elif (XTIMER_HZ == XTIMER_HZ_BASE)
 /**
  * @brief   xtimer prescaler value
  *
-- 
GitLab