mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 15:03:53 +01:00
sys/shell/sc_gnrc_6ctx: use ztimer if available
This commit is contained in:
parent
75dbf65256
commit
feeffb2b2e
@ -24,9 +24,15 @@
|
||||
#include "net/gnrc/sixlowpan/ctx.h"
|
||||
#include "net/sixlowpan/nd.h"
|
||||
#include "timex.h"
|
||||
#include "xtimer.h"
|
||||
|
||||
#if IS_USED(MODULE_ZTIMER_MSEC)
|
||||
#include "ztimer.h"
|
||||
static ztimer_t del_timer[GNRC_SIXLOWPAN_CTX_SIZE];
|
||||
#else
|
||||
#include "xtimer.h"
|
||||
static xtimer_t del_timer[GNRC_SIXLOWPAN_CTX_SIZE];
|
||||
#endif
|
||||
|
||||
void _del_cb(void *ptr)
|
||||
{
|
||||
gnrc_sixlowpan_ctx_t *ctx = ptr;
|
||||
@ -120,8 +126,13 @@ int _gnrc_6ctx_del(char *cmd_str, char *ctx_str)
|
||||
ctx->ltime = 0;
|
||||
del_timer[cid].callback = _del_cb;
|
||||
del_timer[cid].arg = ctx;
|
||||
#if IS_USED(MODULE_ZTIMER_MSEC)
|
||||
ztimer_set(ZTIMER_MSEC, &del_timer[cid],
|
||||
SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY * MS_PER_SEC);
|
||||
#else
|
||||
xtimer_set(&del_timer[cid],
|
||||
SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY * US_PER_SEC);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user