Mercurial > ecos-v3_0-branch
changeset 2532:af5755a0cc71
* src/common/termiostty.c (set_attr) : Fixed bug for XON/XOFF
flow control that was wrong in termiostty.
set_attr() now looks into c_iflag for IXON/IXOFF flags.
| author | jlarmour |
|---|---|
| date | Wed, 20 Aug 2008 14:48:40 +0000 |
| parents | cc005a9f3575 |
| children | 4f15eaebbf32 |
| files | packages/io/serial/current/ChangeLog packages/io/serial/current/src/common/termiostty.c |
| diffstat | 2 files changed, 18 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,9 @@ +2008-08-13 Rainer Arndt <Arndt-ADT@kieback-peter.de> + + * src/common/termiostty.c (set_attr) : Fixed bug for XON/XOFF + flow control that was wrong in termiostty. + set_attr() now looks into c_iflag for IXON/IXOFF flags. + 2008-01-30 Andrew Lunn <andrew.lunn@ascom.ch> * src/common/termiostty.c (termios_lookup): Add missing set of
--- a/packages/io/serial/current/src/common/termiostty.c +++ b/packages/io/serial/current/src/common/termiostty.c @@ -465,11 +465,11 @@ set_attr( struct termios *t, struct term } } - if ( (t->c_cflag & IXOFF) != (ptermios->c_cflag & IXOFF) ) { + if ( (t->c_iflag & IXOFF) != (ptermios->c_iflag & IXOFF) ) { new_dev_conf = dev_conf; new_dev_conf.flags &= ~(CYGNUM_SERIAL_FLOW_XONXOFF_RX|CYGNUM_SERIAL_FLOW_RTSCTS_RX); - if ( t->c_cflag & IXOFF ) + if ( t->c_iflag & IXOFF ) if ( t->c_cflag & CRTSCTS) new_dev_conf.flags |= CYGNUM_SERIAL_FLOW_RTSCTS_RX; else @@ -485,16 +485,18 @@ set_attr( struct termios *t, struct term // It worked, so update dev_conf to reflect the new state dev_conf.flags = new_dev_conf.flags; // and termios - ptermios->c_cflag &= ~(IXOFF|CRTSCTS); - ptermios->c_cflag |= t->c_cflag & (IXOFF|CRTSCTS); + ptermios->c_cflag &= ~(CRTSCTS); + ptermios->c_cflag |= t->c_cflag & (CRTSCTS); + ptermios->c_iflag &= ~(IXOFF); + ptermios->c_iflag |= t->c_iflag & (IXOFF); } } - if ( (t->c_cflag & IXON) != (ptermios->c_cflag & IXON) ) { + if ( (t->c_iflag & IXON) != (ptermios->c_iflag & IXON) ) { new_dev_conf = dev_conf; new_dev_conf.flags &= ~(CYGNUM_SERIAL_FLOW_XONXOFF_TX|CYGNUM_SERIAL_FLOW_RTSCTS_TX); - if ( t->c_cflag & IXON ) + if ( t->c_iflag & IXON ) if ( t->c_cflag & CRTSCTS) new_dev_conf.flags |= CYGNUM_SERIAL_FLOW_RTSCTS_TX; else @@ -510,8 +512,10 @@ set_attr( struct termios *t, struct term // It worked, so update dev_conf to reflect the new state dev_conf.flags = new_dev_conf.flags; // and termios - ptermios->c_cflag &= ~(IXON|CRTSCTS); - ptermios->c_cflag |= t->c_cflag & (IXON|CRTSCTS); + ptermios->c_cflag &= ~(CRTSCTS); + ptermios->c_cflag |= t->c_cflag & (CRTSCTS); + ptermios->c_iflag &= ~(IXON); + ptermios->c_iflag |= t->c_iflag & (IXON); } }
