You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2015/11/17 00:41:42 UTC
incubator-mynewt-larva git commit: Open console port to be stdout,
as opposed to pty
Repository: incubator-mynewt-larva
Updated Branches:
refs/heads/master 4255270f4 -> 845b5fa50
Open console port to be stdout, as opposed to pty
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/845b5fa5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/845b5fa5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/845b5fa5
Branch: refs/heads/master
Commit: 845b5fa5085f5f82b867ebe0ccf4da769a6ce301
Parents: 4255270
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Nov 16 15:41:06 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon Nov 16 15:41:06 2015 -0800
----------------------------------------------------------------------
hw/mcu/native/src/hal_uart.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/845b5fa5/hw/mcu/native/src/hal_uart.c
----------------------------------------------------------------------
diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index b4c2497..bf0530a 100644
--- a/hw/mcu/native/src/hal_uart.c
+++ b/hw/mcu/native/src/hal_uart.c
@@ -141,7 +141,7 @@ set_nonblock(int fd)
static int
-uart_pty(void)
+uart_pty(int port)
{
int fd;
int loop_slave;
@@ -168,7 +168,7 @@ uart_pty(void)
goto err;
}
- printf("console at %s\n", pty_name);
+ printf("uart%d at %s\n", port, pty_name);
return fd;
err:
close(fd);
@@ -252,8 +252,12 @@ hal_uart_config(int port, int32_t baudrate, uint8_t databits, uint8_t stopbits,
return -1;
}
- uart->u_fd = uart_pty();
-
+ if (port != CONSOLE_UART) {
+ uart->u_fd = uart_pty(port);
+ } else {
+ uart->u_fd = fileno_unlocked(stdout);
+ printf("uart%d at stdout\n", port);
+ }
if (uart->u_fd < 0) {
return -1;
}