nimble: allow to override host thread priority
This commit is contained in:
parent
8794b357a1
commit
d94b4af0d3
@ -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)
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#define NIMBLE_RIOT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user