1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 17:01:19 +01:00

Merge pull request #17357 from kfessel/p-evtimer32

sys/evtimer,ztimer: do not depend on ztimer_now64
This commit is contained in:
Francisco 2021-12-15 13:24:44 +01:00 committed by GitHub
commit fe850e8919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 38 additions and 4 deletions

View File

@ -19,6 +19,8 @@ USEMODULE += gnrc_icmpv6_echo
USEMODULE += nanocoap_sock
USEMODULE += xtimer
# include this for nicely formatting the returned internal value
USEMODULE += fmt

View File

@ -23,7 +23,6 @@
#include "thread.h"
#include "irq.h"
#include "net/nanocoap_sock.h"
#include "xtimer.h"
#include "shell.h"

View File

@ -5,6 +5,7 @@ USEMODULE += hashes
USEMODULE += random
USEMODULE += tinydtls_aes
USEMODULE += tinydtls_ecc
USEMODULE += xtimer
# TinyDTLS only has support for 32-bit architectures ATM
FEATURES_REQUIRED += arch_32bit

View File

@ -22,6 +22,7 @@
#include "log.h"
#include "net/sock/dtls.h"
#include "net/credman.h"
#include "xtimer.h"
#if SOCK_HAS_ASYNC
#include "net/sock/async.h"

View File

@ -154,6 +154,7 @@ endif
ifneq (,$(filter uhcpc,$(USEMODULE)))
USEMODULE += posix_inet
USEMODULE += xtimer
endif
ifneq (,$(filter netdev_tap,$(USEMODULE)))
@ -744,6 +745,7 @@ endif
ifneq (,$(filter suit_transport_coap, $(USEMODULE)))
USEMODULE += nanocoap_sock
USEMODULE += xtimer
USEMODULE += sock_util
endif

View File

@ -137,6 +137,9 @@ static inline uint32_t evtimer_now_msec(void)
/**
* @brief Return the current system time in minutes
*
* @deprecated wrongly placed convenience function, that
* may not work as expected with ztimer (32 bit)
*/
static inline uint32_t evtimer_now_min(void)
{

View File

@ -124,7 +124,7 @@ ifneq (,$(filter gnrc_ipv6_auto_subnets,$(USEMODULE)))
USEMODULE += gnrc_ipv6_nib_rtr_adv_pio_cb
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ADV_ROUTER=0
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA=1
USEMODULE += xtimer
ifeq (,$(filter gnrc_ipv6_auto_subnets_simple,$(USEMODULE)))
DEFAULT_MODULE += gnrc_ipv6_auto_subnets_auto_init
USEMODULE += gnrc_udp

View File

@ -26,7 +26,9 @@
#include "net/gnrc/tx_sync.h"
#include "net/udp.h"
#include "utlist.h"
#ifdef MODULE_XTIMER
#include "xtimer.h"
#endif
#include "sock_types.h"
#include "gnrc_sock_internal.h"

View File

@ -8,4 +8,5 @@ ifneq (,$(filter benchmark_udp,$(USEMODULE)))
USEMODULE += netutils
USEMODULE += sema_inv
USEMODULE += sock_udp
USEMODULE += xtimer
endif

View File

@ -34,7 +34,6 @@ endif
# make evtimer use ztimer_msec as low level timer
ifneq (,$(filter evtimer_on_ztimer,$(USEMODULE)))
USEMODULE += ztimer_msec
USEMODULE += ztimer_now64
endif
# "ztimer_xtimer_compat" is a wrapper of the xtimer API on ztimer_used

View File

@ -6,6 +6,7 @@ BOARD_INSUFFICIENT_MEMORY := \
arduino-uno \
atmega328p \
atmega328p-xplained-mini \
bluepill-stm32f030c8 \
i-nucleo-lrwan1 \
msb-430 \
msb-430h \
@ -15,6 +16,7 @@ BOARD_INSUFFICIENT_MEMORY := \
nucleo-l031k6 \
nucleo-l053r8 \
samd10-xmini \
slstk3400a \
stk3200 \
stm32f030f4-demo \
stm32f0discovery \

View File

@ -1,5 +1,6 @@
include ../Makefile.tests_common
USEMODULE += evtimer
USEMODULE += xtimer
include $(RIOTBASE)/Makefile.include

View File

@ -23,6 +23,7 @@
#include "evtimer_msg.h"
#include "thread.h"
#include "msg.h"
#include "xtimer.h"
#define WORKER_MSG_QUEUE_SIZE (8)
@ -45,7 +46,7 @@ static evtimer_msg_event_t events[] = {
/* This thread will print the drift to stdout once per second */
void *worker_thread(void *arg)
{
(void) arg;
(void)arg;
msg_init_queue(worker_msg_queue, WORKER_MSG_QUEUE_SIZE);
while (1) {
@ -58,6 +59,11 @@ void *worker_thread(void *arg)
}
}
void sleep_msec(uint16_t t)
{
xtimer_msleep(t);
}
int main(void)
{
evtimer_init_msg(&evtimer);
@ -67,9 +73,11 @@ int main(void)
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST,
worker_thread, NULL, "worker");
while (1) {
for (unsigned i = 0; i < NEVENTS; i++) {
evtimer_add_msg(&evtimer, &events[i], pid);
sleep_msec(10);
}
}
}

View File

@ -10,7 +10,10 @@ BOARD_INSUFFICIENT_MEMORY := \
atxmega-a3bu-xplained \
bluepill-stm32f030c8 \
derfmega128 \
hifive1 \
hifive1b \
i-nucleo-lrwan1 \
im880b \
mega-xplained \
microduino-corerf \
msb-430 \

View File

@ -20,6 +20,8 @@ USEMODULE += sock_ip
USEMODULE += gnrc_ipv6
USEMODULE += ps
USEMODULE += xtimer
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include

View File

@ -8,7 +8,9 @@ BOARD_INSUFFICIENT_MEMORY := \
nucleo-f031k6 \
nucleo-f042k6 \
nucleo-l011k4 \
nucleo-l031k6\
samd10-xmini \
stk3200 \
stm32f030f4-demo \
stm32g0316-disco \
#

View File

@ -20,6 +20,8 @@ USEMODULE += gnrc_sock_check_reuse
USEMODULE += sock_udp
USEMODULE += gnrc_ipv6
USEMODULE += ps
USEMODULE += xtimer
CFLAGS += -DTEST_SUITES

View File

@ -11,6 +11,8 @@ USEMODULE += gnrc_icmpv6_echo
USEMODULE += sock_udp
USEMODULE += xtimer
USEPKG += microcoap
# include this for printing IP addresses

View File

@ -16,8 +16,10 @@ BOARD_INSUFFICIENT_MEMORY := \
nucleo-f334r8 \
nucleo-g070rb \
nucleo-g071rb \
nucleo-g431rb \
nucleo-l031k6 \
nucleo-l053r8 \
nucleo-l412kb \
saml10-xpro \
saml11-xpro \
slstk3400a \