summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k/gen68360
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-05-23 15:48:38 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-05-23 15:48:38 +0000
commit6825d0657a3b49fe681f9ebbbd2195fbfdb5bb4c (patch)
tree0cdc451979911125452a25e84009c4bf7a1b7e58 /c/src/lib/libbsp/m68k/gen68360
parent2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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/gen68360')
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/ChangeLog6
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/console/console.c33
2 files changed, 12 insertions, 27 deletions
diff --git a/c/src/lib/libbsp/m68k/gen68360/ChangeLog b/c/src/lib/libbsp/m68k/gen68360/ChangeLog
index 4379aa486d..6bcdbed1ee 100644
--- a/c/src/lib/libbsp/m68k/gen68360/ChangeLog
+++ b/c/src/lib/libbsp/m68k/gen68360/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/gen68360/console/console.c b/c/src/lib/libbsp/m68k/gen68360/console/console.c
index 1cf6aef777..cf5920c75d 100644
--- a/c/src/lib/libbsp/m68k/gen68360/console/console.c
+++ b/c/src/lib/libbsp/m68k/gen68360/console/console.c
@@ -83,33 +83,12 @@ smc1BRGC (int baud)
static int
smc1SetAttributes (int minor, const struct termios *t)
{
- int baud;
-
- switch (t->c_cflag & CBAUD) {
- default: baud = -1; break;
- case B50: baud = 50; break;
- case B75: baud = 75; break;
- case B110: baud = 110; break;
- case B134: baud = 134; break;
- case B150: baud = 150; break;
- case B200: baud = 200; break;
- case B300: baud = 300; break;
- case B600: baud = 600; break;
- case B1200: baud = 1200; break;
- case B1800: baud = 1800; break;
- case B2400: baud = 2400; break;
- case B4800: baud = 4800; break;
- case B9600: baud = 9600; break;
- case B19200: baud = 19200; break;
- case B38400: baud = 38400; break;
- case B57600: baud = 57600; break;
- case B115200: baud = 115200; break;
- case B230400: baud = 230400; break;
- case B460800: baud = 460800; break;
- }
- if (baud > 0)
- m360.brgc1 = smc1BRGC (baud);
- return 0;
+ int baud;
+
+ baud = termios_baud_to_number(t->c_cflag & CBAUD);
+ if (baud > 0)
+ m360.brgc1 = smc1BRGC (baud);
+ return 0;
}
/*