forked from Imagelibrary/rtems
2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* console/console.c: Properly inform termios of our initial baud rate. If it is not the default, this causes problems when an application changes any termios attributes since termios thinks our baud rate is one thing when in fact, it is another.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* console/console.c: Properly inform termios of our initial baud rate.
|
||||
If it is not the default, this causes problems when an application
|
||||
changes any termios attributes since termios thinks our baud rate is
|
||||
one thing when in fact, it is another.
|
||||
|
||||
2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* startup/bspstart.c: Add capability for bootcard.c BSP Initialization
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
/* Saskatoon, Saskatchewan, CANADA */
|
||||
/* eric@skatter.usask.ca */
|
||||
/* */
|
||||
/* COPYRIGHT (c) 1989-1998. */
|
||||
/* COPYRIGHT (c) 1989-2008. */
|
||||
/* On-Line Applications Research Corporation (OAR). */
|
||||
/* */
|
||||
/* Modifications by Darlene Stewart <Darlene.Stewart@iit.nrc.ca> */
|
||||
@@ -103,6 +103,7 @@
|
||||
#include <rtems/bspIo.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <string.h>
|
||||
#include <rtems/termiostypes.h>
|
||||
|
||||
|
||||
#define NUM_PORTS MPC5200_PSC_NO
|
||||
@@ -343,7 +344,8 @@ static void mpc5200_psc_interrupt_handler(rtems_irq_hdl_param handle)
|
||||
c = (psc->rb_tb >> 24);
|
||||
|
||||
if (ttyp[minor] != NULL) {
|
||||
nb_overflow = rtems_termios_enqueue_raw_characters((void *)ttyp[minor], (char *)&c, (int)1);
|
||||
nb_overflow = rtems_termios_enqueue_raw_characters(
|
||||
(void *)ttyp[minor], (char *)&c, (int)1);
|
||||
channel_info[minor].rx_characters++;
|
||||
}
|
||||
|
||||
@@ -497,7 +499,8 @@ void mpc5200_uart_psc_initialize(int minor) {
|
||||
*/
|
||||
psc->tfalarm = 1;
|
||||
|
||||
baud_divider = (IPB_CLOCK + GEN5200_CONSOLE_BAUD *16) / (GEN5200_CONSOLE_BAUD * 32);
|
||||
baud_divider =
|
||||
(IPB_CLOCK + GEN5200_CONSOLE_BAUD *16) / (GEN5200_CONSOLE_BAUD * 32);
|
||||
|
||||
/*
|
||||
* Set upper timer counter
|
||||
@@ -683,7 +686,11 @@ static void A_BSP_output_char( char c )
|
||||
/*
|
||||
* Initialize and register the device
|
||||
*/
|
||||
rtems_device_driver console_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
|
||||
rtems_device_driver console_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg
|
||||
)
|
||||
{
|
||||
|
||||
rtems_status_code status;
|
||||
@@ -735,11 +742,13 @@ rtems_device_driver console_initialize(rtems_device_major_number major, rtems_de
|
||||
/*
|
||||
* Open the device
|
||||
*/
|
||||
rtems_device_driver console_open(rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
|
||||
{
|
||||
#ifdef UARTS_USE_TERMIOS_INT
|
||||
rtems_device_driver console_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg
|
||||
)
|
||||
{
|
||||
rtems_libio_open_close_args_t *args = arg;
|
||||
#endif
|
||||
rtems_status_code sc;
|
||||
|
||||
#ifdef UARTS_USE_TERMIOS_INT
|
||||
@@ -773,14 +782,18 @@ rtems_device_driver console_open(rtems_device_major_number major, rtems_device_m
|
||||
|
||||
#ifdef UARTS_USE_TERMIOS_INT
|
||||
sc = rtems_termios_open( major, minor, arg, &intrCallbacks );
|
||||
ttyp[minor] = args->iop->data1; /* Keep cookie returned by termios_open */
|
||||
#else /* RTEMS polled I/O with termios */
|
||||
sc = rtems_termios_open( major, minor, arg, &pollCallbacks );
|
||||
#endif
|
||||
|
||||
ttyp[minor] = args->iop->data1; /* Keep cookie returned by termios_open */
|
||||
|
||||
if ( !sc )
|
||||
rtems_termios_set_initial_baud( ttyp[minor], GEN5200_CONSOLE_BAUD );
|
||||
|
||||
return sc;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user