summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-10 14:54:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-10 14:54:52 +0000
commite9bb4fbc7539300476dfa04fb64354b0a0f30aac (patch)
tree2cbeaa84843376ef99e62890839ff1a39737b70e /c
parent2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-e9bb4fbc7539300476dfa04fb64354b0a0f30aac.tar.bz2
2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* console.c: Fix tabs and allow the BSP to override the default baud rate.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/shared/ChangeLog5
-rw-r--r--c/src/lib/libbsp/shared/console.c42
2 files changed, 30 insertions, 17 deletions
diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog
index 1cdeb57647..016e2e4602 100644
--- a/c/src/lib/libbsp/shared/ChangeLog
+++ b/c/src/lib/libbsp/shared/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * console.c: Fix tabs and allow the BSP to override the default baud
+ rate.
+
2009-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* src/irq-generic.c: Priority inheritance on simple binary semaphores
diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c
index c477aae4eb..440a2cb293 100644
--- a/c/src/lib/libbsp/shared/console.c
+++ b/c/src/lib/libbsp/shared/console.c
@@ -82,26 +82,34 @@ rtems_device_driver console_open(
status = rtems_termios_open ( major, minor, arg, &Callbacks );
Console_Port_Data[minor].termios_data = args->iop->data1;
- /* Get tty pointeur from the Console_Port_Data */
+ /* Get tty pointur from the Console_Port_Data */
current_tty = Console_Port_Data[minor].termios_data;
if ( (current_tty->refcount == 1) ) {
- /*
- * If it's the first open, modified, if need, the port parameters
- */
- if (minor!=Console_Port_Minor) {
- /*
- * If this is not the console we do not want ECHO and
- * so forth
- */
- IoctlArgs.iop=args->iop;
- IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
- IoctlArgs.buffer=&Termios;
- rtems_termios_ioctl(&IoctlArgs);
- Termios.c_lflag=ICANON;
- IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
- rtems_termios_ioctl(&IoctlArgs);
- }
+
+ /*
+ * If this BSP has a preferred default rate, then use that.
+ */
+ #if defined(BSP_DEFAULT_BAUD_RATE)
+ rtems_termios_set_initial_baud( current_tty, BSP_DEFAULT_BAUD_RATE );
+ #endif
+
+ /*
+ * If it's the first open, modified, if need, the port parameters
+ */
+ if (minor!=Console_Port_Minor) {
+ /*
+ * If this is not the console we do not want ECHO and
+ * so forth
+ */
+ IoctlArgs.iop=args->iop;
+ IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
+ IoctlArgs.buffer=&Termios;
+ rtems_termios_ioctl(&IoctlArgs);
+ Termios.c_lflag=ICANON;
+ IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
+ rtems_termios_ioctl(&IoctlArgs);
+ }
}
if ( (args->iop->flags&LIBIO_FLAGS_READ) &&