From 02d7d2585095245b7d9dc106cb3eacd167a6c4b7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Stekiel Date: Tue, 19 Jun 2018 08:55:35 +0200 Subject: [PATCH] us_ticker_set_interrupt: fix bit-shift operation --- targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c index de7be86bd4..60d82d2f4a 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c @@ -110,7 +110,7 @@ void us_ticker_set_interrupt(timestamp_t timestamp) { core_util_critical_section_enter(); - const uint32_t counter_mask = ((1 << US_TICKER_COUNTER_BITS) - 1); + const uint32_t counter_mask = ((1ULL << US_TICKER_COUNTER_BITS) - 1); nrf_timer_cc_write(NRF_TIMER1, NRF_TIMER_CC_CHANNEL0, timestamp & counter_mask);