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

examples: spending the main thread a message queue

Since it is likely that the main thread will send netapi IPC calls that expects a reply. These replies may come faster than the thread can handle them, causing the layers below to stuck.
This commit is contained in:
Oleg Hahm 2015-09-30 17:56:57 +02:00
parent e3045e8afe
commit b538c74229
2 changed files with 14 additions and 0 deletions

View File

@ -21,9 +21,16 @@
#include <stdio.h>
#include "shell.h"
#include "msg.h"
#define MAIN_QUEUE_SIZE (8)
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
int main(void)
{
/* we need a message queue for the thread running the shell in order to
* receive potentially fast incoming networking packets */
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);
puts("RIOT border router example application");
/* start shell */

View File

@ -21,6 +21,10 @@
#include <stdio.h>
#include "shell.h"
#include "msg.h"
#define MAIN_QUEUE_SIZE (8)
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
extern int udp_cmd(int argc, char **argv);
@ -31,6 +35,9 @@ static const shell_command_t shell_commands[] = {
int main(void)
{
/* we need a message queue for the thread running the shell in order to
* receive potentially fast incoming networking packets */
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);
puts("RIOT network stack example application");
/* start shell */