Skip to content

Commit

Permalink
ng_sniffer: use uart0 only for none newlib boards
Browse files Browse the repository at this point in the history
Related and dependent on RIOT-OS#3555
  • Loading branch information
OlegHahm committed Aug 4, 2015
1 parent 76362f9 commit 18965d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion ng_sniffer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ RIOTBASE ?= $(CURDIR)/../../RIOT
# Define modules that are used
USEMODULE += ng_netif_default
USEMODULE += auto_init_ng_netif
USEMODULE += uart0
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps
Expand Down
12 changes: 10 additions & 2 deletions ng_sniffer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
#include "hwtimer.h"
#include "shell.h"
#include "shell_commands.h"
#include "posix_io.h"
#include "board_uart0.h"
#ifdef MODULE_NEWLIB
# include "uart_stdio.h"
#else
# include "posix_io.h"
# include "board_uart0.h"
#endif
#include "net/ng_netbase.h"

/**
Expand Down Expand Up @@ -111,8 +115,12 @@ int main(void)

/* start the shell */
puts("All ok, starting the shell now");
#ifndef MODULE_NEWLIB
(void) posix_open(uart0_handler_pid, 0);
shell_init(&shell, NULL, SHELL_BUFSIZE, uart0_readc, uart0_putc);
#else
shell_init(&shell, NULL, SHELL_BUFSIZE, getchar, putchar);
#endif
shell_run(&shell);

return 0;
Expand Down

0 comments on commit 18965d5

Please sign in to comment.