diff --git a/porting/npl/riot/include/nimble/nimble_npl_os.h b/porting/npl/riot/include/nimble/nimble_npl_os.h index 16f514b84..e039ad654 100644 --- a/porting/npl/riot/include/nimble/nimble_npl_os.h +++ b/porting/npl/riot/include/nimble/nimble_npl_os.h @@ -218,6 +218,12 @@ ble_npl_callout_get_ticks(struct ble_npl_callout *co) return co->target_ticks; } +static inline void +ble_npl_callout_set_arg(struct ble_npl_callout *co, void *arg) +{ + co->e.arg = arg; +} + static inline uint32_t ble_npl_time_get(void) { diff --git a/porting/npl/riot/src/npl_os_riot.c b/porting/npl/riot/src/npl_os_riot.c index 98a5edf49..cc3909e7d 100644 --- a/porting/npl/riot/src/npl_os_riot.c +++ b/porting/npl/riot/src/npl_os_riot.c @@ -66,3 +66,11 @@ ble_npl_callout_reset(struct ble_npl_callout *c, ble_npl_time_t ticks) xtimer_set(&c->timer, ((ticks * 1000) - ((xtimer_now_usec() - now) / 1000))); return BLE_NPL_OK; } + +uint32_t +ble_npl_callout_remaining_ticks(struct ble_npl_callout *co, + ble_npl_time_t time) +{ + uint32_t now = xtimer_now_usec(); + return ((uint32_t)co->target_ticks) - (now / 1000); +}