mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request https://github.com/RIOT-OS/applications/pull/11 from OlegHahm/ng_sniffer_shell_uart
ng_sniffer: use uart0 only for none newlib boards
This commit is contained in:
commit
66e3cb9578
@ -10,7 +10,6 @@ RIOTBASE ?= $(CURDIR)/../../RIOT
|
|||||||
# Define modules that are used
|
# Define modules that are used
|
||||||
USEMODULE += ng_netif_default
|
USEMODULE += ng_netif_default
|
||||||
USEMODULE += auto_init_ng_netif
|
USEMODULE += auto_init_ng_netif
|
||||||
USEMODULE += uart0
|
|
||||||
USEMODULE += shell
|
USEMODULE += shell
|
||||||
USEMODULE += shell_commands
|
USEMODULE += shell_commands
|
||||||
USEMODULE += ps
|
USEMODULE += ps
|
||||||
|
@ -25,8 +25,12 @@
|
|||||||
#include "hwtimer.h"
|
#include "hwtimer.h"
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
#include "shell_commands.h"
|
#include "shell_commands.h"
|
||||||
#include "posix_io.h"
|
#ifdef MODULE_NEWLIB
|
||||||
#include "board_uart0.h"
|
# include "uart_stdio.h"
|
||||||
|
#else
|
||||||
|
# include "posix_io.h"
|
||||||
|
# include "board_uart0.h"
|
||||||
|
#endif
|
||||||
#include "net/ng_netbase.h"
|
#include "net/ng_netbase.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,8 +115,12 @@ int main(void)
|
|||||||
|
|
||||||
/* start the shell */
|
/* start the shell */
|
||||||
puts("All ok, starting the shell now");
|
puts("All ok, starting the shell now");
|
||||||
|
#ifndef MODULE_NEWLIB
|
||||||
(void) posix_open(uart0_handler_pid, 0);
|
(void) posix_open(uart0_handler_pid, 0);
|
||||||
shell_init(&shell, NULL, SHELL_BUFSIZE, uart0_readc, uart0_putc);
|
shell_init(&shell, NULL, SHELL_BUFSIZE, uart0_readc, uart0_putc);
|
||||||
|
#else
|
||||||
|
shell_init(&shell, NULL, SHELL_BUFSIZE, getchar, putchar);
|
||||||
|
#endif
|
||||||
shell_run(&shell);
|
shell_run(&shell);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user