Browse Source

examples: every socket thread needs a msg queue

cc430
Oleg Hahm 7 years ago
parent
commit
fdf6da07eb
  1. 7
      examples/posix_sockets/main.c

7
examples/posix_sockets/main.c

@ -20,9 +20,11 @@
#include <stdio.h>
#include "msg.h"
#include "shell.h"
#define MAIN_MSG_QUEUE_SIZE (1)
#define MAIN_MSG_QUEUE_SIZE (4)
static msg_t main_msg_queue[MAIN_MSG_QUEUE_SIZE];
extern int udp_cmd(int argc, char **argv);
@ -33,6 +35,9 @@ static const shell_command_t shell_commands[] = {
int main(void)
{
/* a sendto() call performs an implicit bind(), hence, a message queue is
* required for the thread executing the shell */
msg_init_queue(main_msg_queue, MAIN_MSG_QUEUE_SIZE);
puts("RIOT socket example application");
/* start shell */
puts("All up, running the shell now");

Loading…
Cancel
Save