gnrc_netif: add GNRC_NETIF_SINGLE macro
This commit is contained in:
parent
e451570219
commit
44f7cb712c
@ -29,6 +29,18 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Single interface optimizations
|
||||
*
|
||||
* Define to 1 to allow GNRC optimizations when only one interface
|
||||
* is available.
|
||||
*
|
||||
* @note This MUST NOT be enabled if there's more than one interface.
|
||||
*/
|
||||
#if DOXYGEN
|
||||
#define GNRC_NETIF_SINGLE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Default priority for network interface threads
|
||||
*/
|
||||
|
||||
@ -49,9 +49,9 @@ int gnrc_netif_create(gnrc_netif_t *netif, char *stack, int stacksize, char prio
|
||||
{
|
||||
int res;
|
||||
|
||||
if (IS_ACTIVE(DEVELHELP) && IS_ACTIVE(GNRC_NETIF_SINGLE) && netif_iter(NULL)) {
|
||||
LOG_WARNING("gnrc_netif: GNRC_NETIF_SINGLE set but more than one "
|
||||
"interface is being registered.");
|
||||
if (IS_ACTIVE(DEVELHELP) && gnrc_netif_highlander() && netif_iter(NULL)) {
|
||||
LOG_WARNING("gnrc_netif: gnrc_netif_highlander() returned true but "
|
||||
"more than one interface is being registered.\n");
|
||||
assert(netif_iter(NULL) == NULL);
|
||||
}
|
||||
rmutex_init(&netif->mutex);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user