Numerous changes made during the course of integration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1552 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
a3a513364d
commit
7ca7a402df
@ -472,15 +472,20 @@ static int ez80_interrrupt(int irq, void *context)
|
|||||||
struct ez80_dev_s *priv;
|
struct ez80_dev_s *priv;
|
||||||
volatile uint32 cause;
|
volatile uint32 cause;
|
||||||
|
|
||||||
|
#ifndef CONFIG_UART0_DISABLE
|
||||||
if (g_uart0priv.irq == irq)
|
if (g_uart0priv.irq == irq)
|
||||||
{
|
{
|
||||||
dev = &g_uart0port;
|
dev = &g_uart0port;
|
||||||
}
|
}
|
||||||
else if (g_uart1priv.irq == irq)
|
else
|
||||||
|
#endif
|
||||||
|
#ifndef CONFIG_UART1_DISABLE
|
||||||
|
if (g_uart1priv.irq == irq)
|
||||||
{
|
{
|
||||||
dev = &g_uart1port;
|
dev = &g_uart1port;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
PANIC(OSERR_INTERNAL);
|
PANIC(OSERR_INTERNAL);
|
||||||
}
|
}
|
||||||
@ -488,14 +493,18 @@ static int ez80_interrrupt(int irq, void *context)
|
|||||||
|
|
||||||
cause = ez80_serialin(priv, EZ80_UART_IIR) & EZ80_UARTIIR_CAUSEMASK;
|
cause = ez80_serialin(priv, EZ80_UART_IIR) & EZ80_UARTIIR_CAUSEMASK;
|
||||||
|
|
||||||
if (cause == (EZ80_UARTINSTS_CTO|EZ80_UARTIIR_INTBIT) ||
|
/* Check for character timeout (CTO) or Receiver Data Ready (RDR) */
|
||||||
cause == (EZ80_UARTINSTS_RDR|EZ80_UARTIIR_INTBIT))
|
|
||||||
|
if (cause == EZ80_UARTINSTS_CTO || cause == EZ80_UARTINSTS_RDR)
|
||||||
{
|
{
|
||||||
/* Receive characters from the RX fifo */
|
/* Receive characters from the RX fifo */
|
||||||
|
|
||||||
uart_recvchars(dev);
|
uart_recvchars(dev);
|
||||||
}
|
}
|
||||||
else if (cause == (EZ80_UARTINSTS_TC|EZ80_UARTIIR_INTBIT))
|
|
||||||
|
/* Check for transmission buffer empty */
|
||||||
|
|
||||||
|
else if (cause == EZ80_UARTINSTS_TBE)
|
||||||
{
|
{
|
||||||
uart_xmitchars(dev);
|
uart_xmitchars(dev);
|
||||||
}
|
}
|
||||||
@ -655,13 +664,11 @@ static boolean ez80_txempty(struct uart_dev_s *dev)
|
|||||||
* Name: up_serialinit
|
* Name: up_serialinit
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Performs the low level UART initialization early in
|
* Register serial console and serial ports.
|
||||||
* debug so that the serial console will be available
|
|
||||||
* during bootup. This must be called before up_serialinit.
|
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_earlyserialinit(void)
|
void up_serialinit(void)
|
||||||
{
|
{
|
||||||
ubyte regval;
|
ubyte regval;
|
||||||
|
|
||||||
@ -712,19 +719,9 @@ void up_earlyserialinit(void)
|
|||||||
CONSOLE_DEV.isconsole = TRUE;
|
CONSOLE_DEV.isconsole = TRUE;
|
||||||
ez80_setup(&CONSOLE_DEV);
|
ez80_setup(&CONSOLE_DEV);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/* Register console and tty devices */
|
||||||
* Name: up_serialinit
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Register serial console and serial ports. This assumes
|
|
||||||
* that up_earlyserialinit was called previously.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
void up_serialinit(void)
|
|
||||||
{
|
|
||||||
#ifdef CONSOLE_DEV
|
#ifdef CONSOLE_DEV
|
||||||
(void)uart_register("/dev/console", &CONSOLE_DEV);
|
(void)uart_register("/dev/console", &CONSOLE_DEV);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user