mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-27 12:20:02 +00:00
npl/riot: add missing callout functions
This commit is contained in:
committed by
Andrzej Kaczmarek
parent
32ccc39fe3
commit
4c3c91bbb3
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user