npl/riot: add missing callout functions

This commit is contained in:
Hauke Petersen
2019-05-29 12:13:18 +02:00
committed by Andrzej Kaczmarek
parent 32ccc39fe3
commit 4c3c91bbb3
2 changed files with 14 additions and 0 deletions
@@ -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)
{
+8
View File
@@ -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);
}