diff --git a/porting/npl/riot/include/nimble/nimble_npl_os.h b/porting/npl/riot/include/nimble/nimble_npl_os.h index 0e1d387f47..854fd06c13 100644 --- a/porting/npl/riot/include/nimble/nimble_npl_os.h +++ b/porting/npl/riot/include/nimble/nimble_npl_os.h @@ -225,10 +225,10 @@ ble_npl_callout_set_arg(struct ble_npl_callout *co, void *arg) co->e.arg = arg; } -static inline uint32_t +static inline ble_npl_time_t ble_npl_time_get(void) { - return xtimer_now_usec64() / US_PER_MS; + return (ble_npl_time_t)(xtimer_now_usec64() / US_PER_MS); } static inline ble_npl_error_t diff --git a/porting/npl/riot/src/npl_os_riot.c b/porting/npl/riot/src/npl_os_riot.c index 2662049367..2f4efd8ba5 100644 --- a/porting/npl/riot/src/npl_os_riot.c +++ b/porting/npl/riot/src/npl_os_riot.c @@ -39,7 +39,8 @@ ble_npl_sem_pend(struct ble_npl_sem *sem, ble_npl_time_t timeout) struct timespec abs; uint64_t time; - time = xtimer_now_usec64() + ble_npl_time_ticks_to_ms32(timeout) * US_PER_MS; + time = xtimer_now_usec64() + + (ble_npl_time_ticks_to_ms32(timeout) * US_PER_MS); abs.tv_sec = (time_t)(time / US_PER_SEC); abs.tv_nsec = (long)((time % US_PER_SEC) * NS_PER_US);