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/mcf5235 | |
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/mcf5235')
-rw-r--r-- | c/src/lib/libbsp/m68k/mcf5235/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mcf5235/console/console.c | 38 |
2 files changed, 7 insertions, 37 deletions
diff --git a/c/src/lib/libbsp/m68k/mcf5235/ChangeLog b/c/src/lib/libbsp/m68k/mcf5235/ChangeLog index 3a203a24ec..f3e89c62e6 100644 --- a/c/src/lib/libbsp/m68k/mcf5235/ChangeLog +++ b/c/src/lib/libbsp/m68k/mcf5235/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-14 Joel Sherrill <joel.sherrill@OARcorp.com> * Makefile.am: Rework to avoid .rel files. diff --git a/c/src/lib/libbsp/m68k/mcf5235/console/console.c b/c/src/lib/libbsp/m68k/mcf5235/console/console.c index 9f627b94fe..9e80d8985e 100644 --- a/c/src/lib/libbsp/m68k/mcf5235/console/console.c +++ b/c/src/lib/libbsp/m68k/mcf5235/console/console.c @@ -62,42 +62,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; - } - return ( baud ); -} - /*************************************************************************** Function : IntUartSet @@ -209,7 +173,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 ) |