diff --git a/pkg/nimble/Makefile.include b/pkg/nimble/Makefile.include index 2784227228..2428778c79 100644 --- a/pkg/nimble/Makefile.include +++ b/pkg/nimble/Makefile.include @@ -86,12 +86,6 @@ endif ifneq (,$(filter nimble_netif,$(USEMODULE))) INCLUDES += -I$(RIOTPKG)/nimble/netif/include - # when using IP, the host should have a higher prio than the netif thread, but - # MUST always have a lower priority then the controller thread. Setting it to - # controller prio plus will guarantee the latter while also matching the first - # condition as long as the default netif prio is not changed. - CFLAGS += -DNIMBLE_HOST_PRIO="(NIMBLE_CONTROLLER_PRIO + 1)" - # configure NimBLE's internals NIMBLE_MAX_CONN ?= 3 CFLAGS += -DMYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM=$(NIMBLE_MAX_CONN) diff --git a/pkg/nimble/contrib/include/nimble_riot.h b/pkg/nimble/contrib/include/nimble_riot.h index dbb3b35350..b61aebd1c3 100644 --- a/pkg/nimble/contrib/include/nimble_riot.h +++ b/pkg/nimble/contrib/include/nimble_riot.h @@ -23,6 +23,7 @@ #define NIMBLE_RIOT_H #include +#include "kernel_defines.h" #ifdef __cplusplus extern "C" { @@ -48,8 +49,18 @@ extern "C" { * @brief Priority used for NimBLE's host thread */ #ifndef NIMBLE_HOST_PRIO +#if IS_USED(MODULE_NIMBLE_NETIF) +/* when using IP, the host should have a higher prio than the netif thread, but + * MUST always have a lower priority then the controller thread. Setting it to + * controller prio plus will guarantee the latter while also matching the first + * condition as long as the default netif prio is not changed. */ +#define NIMBLE_HOST_PRIO (NIMBLE_CONTROLLER_PRIO + 1) +#else #define NIMBLE_HOST_PRIO (THREAD_PRIORITY_MAIN - 2) #endif +#endif + + /** * @brief Stacksize used for NimBLE's host thread