diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-30 12:23:15 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-30 12:23:15 -0600 |
commit | 120e094ac41989be7d62ce90cd7c5eeff8bbd1ae (patch) | |
tree | 35e149b6b71bf51a8223aca58946b90b2fc42aa1 | |
parent | 0706af1418920fe3dc4044387889037fc8ea50d7 (diff) | |
download | px4-nuttx-120e094ac41989be7d62ce90cd7c5eeff8bbd1ae.tar.gz px4-nuttx-120e094ac41989be7d62ce90cd7c5eeff8bbd1ae.tar.bz2 px4-nuttx-120e094ac41989be7d62ce90cd7c5eeff8bbd1ae.zip |
SAM3/4: Fix error serial TERMIOS ioctl handling
-rw-r--r-- | nuttx/arch/arm/src/sam34/sam_serial.c | 6 | ||||
-rw-r--r-- | nuttx/libc/termios/lib_tcsetattr.c | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/sam34/sam_serial.c b/nuttx/arch/arm/src/sam34/sam_serial.c index b558ae7f9..01970b737 100644 --- a/nuttx/arch/arm/src/sam34/sam_serial.c +++ b/nuttx/arch/arm/src/sam34/sam_serial.c @@ -1118,7 +1118,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) /* Decode number of bits */ - switch (priv->bits) + switch (termiosp->c_cflag & CSIZE) { case CS5: nbits = 5; @@ -1147,7 +1147,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) /* Decode parity */ - if (termiosp->c_cflag & PARENB) + if ((termiosp->c_cflag & PARENB) != 0) { parity = (termiosp->c_cflag & PARODD) ? 1 : 2; } @@ -1183,7 +1183,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) * implement TCSADRAIN / TCSAFLUSH */ - up_setup(dev); + ret = up_setup(dev); } } break; diff --git a/nuttx/libc/termios/lib_tcsetattr.c b/nuttx/libc/termios/lib_tcsetattr.c index ec38ec845..8d7b5ccb0 100644 --- a/nuttx/libc/termios/lib_tcsetattr.c +++ b/nuttx/libc/termios/lib_tcsetattr.c @@ -118,5 +118,6 @@ int tcsetattr(int fd, int options, FAR const struct termios *termiosp) { return ioctl(fd, TCSETS, (unsigned long)termiosp); } + return -ENOSYS; } |