diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c index a2ec80d180..5c76f0dbfb 100644 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c @@ -234,7 +234,7 @@ void us_ticker_set_interrupt(timestamp_t timestamp) * microsecond units (in 64-bits). */ const uint64_t currentTime64 = RTC_UNITS_TO_MICROSECONDS(rtc1_getCounter64()); - const uint64_t timestamp64 = currentTime64 + (timestamp - (timestamp_t)currentTime64); + const uint64_t timestamp64 = currentTime64 + (timestamp_t)(timestamp - (timestamp_t)currentTime64); uint32_t newCallbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp64); /* Check for repeat setup of an existing callback. This is actually not