diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-23 15:48:38 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-23 15:48:38 +0000 |
commit | 6825d0657a3b49fe681f9ebbbd2195fbfdb5bb4c (patch) | |
tree | 0cdc451979911125452a25e84009c4bf7a1b7e58 /c/src/lib/libbsp/m68k/uC5282 | |
parent | 2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-6825d0657a3b49fe681f9ebbbd2195fbfdb5bb4c.tar.bz2 |
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
* console/console.c: Eliminate copies of switches to convert termios
Bxxx constants to xxx as an integer. Use the shared
termios_baud_to_number() routine to do the same conversion.
Diffstat (limited to 'c/src/lib/libbsp/m68k/uC5282')
-rw-r--r-- | c/src/lib/libbsp/m68k/uC5282/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/uC5282/console/console.c | 41 |
2 files changed, 7 insertions, 40 deletions
diff --git a/c/src/lib/libbsp/m68k/uC5282/ChangeLog b/c/src/lib/libbsp/m68k/uC5282/ChangeLog index fa0d22756a..3709697737 100644 --- a/c/src/lib/libbsp/m68k/uC5282/ChangeLog +++ b/c/src/lib/libbsp/m68k/uC5282/ChangeLog @@ -1,3 +1,9 @@ +2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com> + + * console/console.c: Eliminate copies of switches to convert termios + Bxxx constants to xxx as an integer. Use the shared + termios_baud_to_number() routine to do the same conversion. + 2008-05-19 Eric Norum <norume@aps.anl.gov> * Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Back diff --git a/c/src/lib/libbsp/m68k/uC5282/console/console.c b/c/src/lib/libbsp/m68k/uC5282/console/console.c index 600bb7a124..7c33809b4b 100644 --- a/c/src/lib/libbsp/m68k/uC5282/console/console.c +++ b/c/src/lib/libbsp/m68k/uC5282/console/console.c @@ -76,45 +76,6 @@ struct IntUartInfoStruct struct IntUartInfoStruct IntUartInfo[MAX_UART_INFO]; -static int GetBaud( int baudHandle ) -{ - int baud = 9600; - switch ( baudHandle ) - { - case B0: - baud = (int)0; - break; - case B1200: - baud = (int)1200; - break; - case B2400: - baud = (int)2400; - break; - case B4800: - baud = (int)4800; - break; - case B9600: - baud = (int)9600; - break; - case B19200: - baud = (int)19200; - break; - case B38400: - baud = (int)38400; - break; - case B57600: - baud = (int)57600; - break; - case B115200: - baud = (int)115200; - break; -/* case B576000: - baud = (int)576000; */ - break; - } - return ( baud ); -} - /*************************************************************************** Function : IntUartSet @@ -226,7 +187,7 @@ IntUartSetAttributes(int minor, const struct termios *t) if ( t != (const struct termios *)0 ) { /* determine baud rate index */ - baud = GetBaud( t->c_cflag & CBAUD ); + baud = termios_baud_to_number(t->c_cflag & CBAUD); /* determine data bits */ switch ( t->c_cflag & CSIZE ) |