From ff928e437962a80a7f5033673cfc9f9ec019fdf8 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Wed, 6 Jul 2016 14:29:54 -0400 Subject: Fix speed setting? --- rpc_serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc_serial.c b/rpc_serial.c index 5dc659e..17addee 100644 --- a/rpc_serial.c +++ b/rpc_serial.c @@ -64,7 +64,6 @@ static int fd = -1; hal_error_t hal_serial_init(const char * const device, const uint32_t speed) { struct termios tty; - speed_t termios_speed; fd = open(device, O_RDWR | O_NOCTTY | O_SYNC); if (fd == -1) { @@ -76,6 +75,7 @@ hal_error_t hal_serial_init(const char * const device, const uint32_t speed) return perror("tcgetattr"), HAL_ERROR_RPC_TRANSPORT; #if !HAL_RPC_SERIAL_USE_MACOSX_IOCTL + speed_t termios_speed; switch (speed) { case 115200: @@ -89,8 +89,8 @@ hal_error_t hal_serial_init(const char * const device, const uint32_t speed) return HAL_ERROR_RPC_TRANSPORT; } - cfsetospeed (&tty, speed); - cfsetispeed (&tty, speed); + cfsetospeed (&tty, termios_speed); + cfsetispeed (&tty, termios_speed); #endif -- cgit v1.2.3