diff options
author | Simon Wilks <sjwilks@gmail.com> | 2013-07-06 15:02:34 +0200 |
---|---|---|
committer | Simon Wilks <sjwilks@gmail.com> | 2013-07-06 15:02:34 +0200 |
commit | 86adaeb3e8f28c92005a38b7c71e12111efe8694 (patch) | |
tree | 4fa3306f280a81f4e90d81b48f12c64e77fa77fe /src/drivers/hott/comms.c | |
parent | 49aca1ae5ba240fc9ae695e58ca392b8d61c939e (diff) | |
download | px4-firmware-86adaeb3e8f28c92005a38b7c71e12111efe8694.tar.gz px4-firmware-86adaeb3e8f28c92005a38b7c71e12111efe8694.tar.bz2 px4-firmware-86adaeb3e8f28c92005a38b7c71e12111efe8694.zip |
More cleanups
Diffstat (limited to 'src/drivers/hott/comms.c')
-rw-r--r-- | src/drivers/hott/comms.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/drivers/hott/comms.c b/src/drivers/hott/comms.c index 4a7d3c845..a2de87407 100644 --- a/src/drivers/hott/comms.c +++ b/src/drivers/hott/comms.c @@ -41,17 +41,17 @@ #include <fcntl.h> #include <nuttx/config.h> -#include <poll.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/ioctl.h> -#include <unistd.h> #include <systemlib/err.h> #include <systemlib/systemlib.h> +#include <termios.h> +#include <unistd.h> int -open_uart(const char *device, struct termios *uart_config_original) +open_uart(const char *device) { /* baud rate */ static const speed_t speed = B19200; @@ -65,7 +65,8 @@ open_uart(const char *device, struct termios *uart_config_original) /* Back up the original uart configuration to restore it after exit */ int termios_state; - if ((termios_state = tcgetattr(uart, uart_config_original)) < 0) { + struct termios uart_config_original; + if ((termios_state = tcgetattr(uart, &uart_config_original)) < 0) { close(uart); err(1, "Error getting baudrate / termios config for %s: %d", device, termios_state); } |