sys/auto_init/netif: Increased cc110x stack size

With the increase of the message queue size from 8 to 16 in
946b06e4f0ea2faf8b63f427dab3720e48790f76, the default stack became too small.
This changes the stack size to grow with the message queue size.
This commit is contained in:
Marian Buschsieweke 2019-06-11 11:32:49 +02:00
parent 972367432a
commit 88cf6cb46f
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -21,22 +21,37 @@
#ifdef MODULE_CC110X #ifdef MODULE_CC110X
#include "log.h"
#include "cc110x.h" #include "cc110x.h"
#include "cc1xxx_common.h" #include "cc1xxx_common.h"
#include "cc110x_params.h" #include "cc110x_params.h"
#include "log.h"
#include "msg.h"
#include "net/gnrc/netif/conf.h" /* <- GNRC_NETIF_MSG_QUEUE_SIZE */
#define ENABLE_DEBUG (0) #define ENABLE_DEBUG (0)
#include "debug.h" #include "debug.h"
#ifndef CC110X_EXTRA_STACKSIZE
/**
* @brief Additional stack size required by the driver
*
* With increasing of GNRC_NETIF_MSG_QUEUE_SIZE the required stack size
* increases as well. A queue size of 8 messages works with default stack size,
* so we increase the stack by `sizeof(msg_t)` for each additional element
*/
#define CC110X_EXTRA_STACKSIZE ((GNRC_NETIF_MSG_QUEUE_SIZE - 8) * sizeof(msg_t))
#endif
/** /**
* @brief Calculate the stack size for the MAC layer thread(s) * @brief Calculate the stack size for the MAC layer thread(s)
*/ */
#define CC110X_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE) #define CC110X_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + \
CC110X_EXTRA_STACKSIZE + \
DEBUG_EXTRA_STACKSIZE)
#ifndef CC110X_MAC_PRIO #ifndef CC110X_MAC_PRIO
/** /**
* @brief The priority of the MAC layer thread * @brief The priority of the MAC layer thread
*/ */
#define CC110X_MAC_PRIO (GNRC_NETIF_PRIO) #define CC110X_MAC_PRIO (GNRC_NETIF_PRIO)
#endif #endif
/** /**