From 6825d0657a3b49fe681f9ebbbd2195fbfdb5bb4c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 23 May 2008 15:48:38 +0000 Subject: 2008-05-23 Joel Sherrill * 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. --- c/src/lib/libbsp/m68k/av5282/console/console.c | 41 +------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'c/src/lib/libbsp/m68k/av5282/console/console.c') diff --git a/c/src/lib/libbsp/m68k/av5282/console/console.c b/c/src/lib/libbsp/m68k/av5282/console/console.c index 1fd8c08c5d..5f80db9972 100644 --- a/c/src/lib/libbsp/m68k/av5282/console/console.c +++ b/c/src/lib/libbsp/m68k/av5282/console/console.c @@ -62,45 +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; -/* case B576000: - baud = (int)576000; */ - break; - } - return ( baud ); -} - /*************************************************************************** Function : IntUartSet @@ -212,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 ) -- cgit v1.2.3