From 3c275370c3f3b5aeecf52d55efd912d28f8e445b Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Mon, 22 Feb 2016 15:25:06 -0500 Subject: [PATCH] xtimer: support a negative XTIMER_SHIFT. --- sys/include/xtimer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/include/xtimer.h b/sys/include/xtimer.h index f58f8f8989..4825a63947 100644 --- a/sys/include/xtimer.h +++ b/sys/include/xtimer.h @@ -342,8 +342,13 @@ int xtimer_msg_receive_timeout64(msg_t *msg, uint64_t us); #define XTIMER_SHIFT (0) #endif +#if (XTIMER_SHIFT < 0) +#define XTIMER_RSHIFT(value) ( (value) << -XTIMER_SHIFT ) +#define XTIMER_LSHIFT(value) ( (value) >> -XTIMER_SHIFT ) +#else #define XTIMER_RSHIFT(value) ( (value) >> XTIMER_SHIFT ) #define XTIMER_LSHIFT(value) ( (value) << XTIMER_SHIFT ) +#endif /** * @brief set xtimer default timer configuration