1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #9087 from miri64/gcoap/enh/conf-msg-queue-size

gcoap: make message queue size configurable
This commit is contained in:
Ken Bannister 2018-05-08 02:43:41 +00:00 committed by GitHub
commit 492d7c1a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -227,7 +227,9 @@ extern "C" {
/**
* @brief Size for module message queue
*/
#ifndef GCOAP_MSG_QUEUE_SIZE
#define GCOAP_MSG_QUEUE_SIZE (4)
#endif
/**
* @brief Server port; use RFC 7252 default if not defined

View File

@ -92,16 +92,17 @@ static gcoap_state_t _coap_state = {
static kernel_pid_t _pid = KERNEL_PID_UNDEF;
static char _msg_stack[GCOAP_STACK_SIZE];
static msg_t _msg_queue[GCOAP_MSG_QUEUE_SIZE];
static sock_udp_t _sock;
/* Event/Message loop for gcoap _pid thread. */
static void *_event_loop(void *arg)
{
msg_t msg_rcvd, msg_queue[GCOAP_MSG_QUEUE_SIZE];
msg_t msg_rcvd;
(void)arg;
msg_init_queue(msg_queue, GCOAP_MSG_QUEUE_SIZE);
msg_init_queue(_msg_queue, GCOAP_MSG_QUEUE_SIZE);
sock_udp_ep_t local;
memset(&local, 0, sizeof(sock_udp_ep_t));