Fixes for serial driver compilation
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2758 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
fc80f25dac
commit
e73af37aed
|
@ -60,6 +60,7 @@
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
|
#include "lpc17_internal.h"
|
||||||
#include "lpc17_uart.h"
|
#include "lpc17_uart.h"
|
||||||
#include "lpc17_serial.h"
|
#include "lpc17_serial.h"
|
||||||
|
|
||||||
|
@ -126,7 +127,7 @@ struct uart_ops_s g_uart_ops =
|
||||||
.send = up_send,
|
.send = up_send,
|
||||||
.txint = up_txint,
|
.txint = up_txint,
|
||||||
.txready = up_txready,
|
.txready = up_txready,
|
||||||
.txempty = up_txempty,
|
.txempty = up_txempty,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* I/O buffers */
|
/* I/O buffers */
|
||||||
|
@ -948,15 +949,34 @@ static int up_interrupt(int irq, void *context)
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
int passes;
|
int passes;
|
||||||
|
|
||||||
if (g_uart1priv.irq == irq)
|
#ifdef CONFIG_LPC17_UART0
|
||||||
{
|
if (g_uart0priv.irq == irq)
|
||||||
dev = &g_uart1port;
|
|
||||||
}
|
|
||||||
else if (g_uart0priv.irq == irq)
|
|
||||||
{
|
{
|
||||||
dev = &g_uart0port;
|
dev = &g_uart0port;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_LPC17_UART1
|
||||||
|
if (g_uart1priv.irq == irq)
|
||||||
|
{
|
||||||
|
dev = &g_uart1port;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_LPC17_UART2
|
||||||
|
if (g_uart2priv.irq == irq)
|
||||||
|
{
|
||||||
|
dev = &g_uart2port;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_LPC17_UART3
|
||||||
|
if (g_uart3priv.irq == irq)
|
||||||
|
{
|
||||||
|
dev = &g_uart3port;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
PANIC(OSERR_INTERNAL);
|
PANIC(OSERR_INTERNAL);
|
||||||
}
|
}
|
||||||
|
@ -1250,28 +1270,28 @@ void up_earlyserialinit(void)
|
||||||
#ifndef CONFIG_UART0_SERIAL_CONSOLE
|
#ifndef CONFIG_UART0_SERIAL_CONSOLE
|
||||||
lpc17_uart0config(g_uart0priv.cclkdiv);
|
lpc17_uart0config(g_uart0priv.cclkdiv);
|
||||||
#endif
|
#endif
|
||||||
up_disableuartint(g_uart0priv.priv, NULL);
|
up_disableuartint(&g_uart0priv, NULL);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LPC17_UART1
|
#ifdef CONFIG_LPC17_UART1
|
||||||
g_uart1priv.cclkdiv = lpc17_uartcclkdiv(CONFIG_UART1_BAUD);
|
g_uart1priv.cclkdiv = lpc17_uartcclkdiv(CONFIG_UART1_BAUD);
|
||||||
#ifndef CONFIG_UART1_SERIAL_CONSOLE
|
#ifndef CONFIG_UART1_SERIAL_CONSOLE
|
||||||
lpc17_uart1config(g_uart1priv.cclkdiv);
|
lpc17_uart1config(g_uart1priv.cclkdiv);
|
||||||
#endif
|
#endif
|
||||||
up_disableuartint(g_uart1priv.priv, NULL);
|
up_disableuartint(&g_uart1priv, NULL);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LPC17_UART2
|
#ifdef CONFIG_LPC17_UART2
|
||||||
g_uart2priv.cclkdiv = lpc17_uartcclkdiv(CONFIG_UART2_BAUD);
|
g_uart2priv.cclkdiv = lpc17_uartcclkdiv(CONFIG_UART2_BAUD);
|
||||||
#ifndef CONFIG_UART2_SERIAL_CONSOLE
|
#ifndef CONFIG_UART2_SERIAL_CONSOLE
|
||||||
lpc17_uart2config(g_uart2priv.cclkdiv);
|
lpc17_uart2config(g_uart2priv.cclkdiv);
|
||||||
#endif
|
#endif
|
||||||
up_disableuartint(g_uart2priv.priv, NULL);
|
up_disableuartint(&g_uart2priv, NULL);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LPC17_UART3
|
#ifdef CONFIG_LPC17_UART3
|
||||||
g_uart3priv.cclkdiv = lpc17_uartcclkdiv(CONFIG_UART3_BAUD);
|
g_uart3priv.cclkdiv = lpc17_uartcclkdiv(CONFIG_UART3_BAUD);
|
||||||
#ifndef CONFIG_UART3_SERIAL_CONSOLE
|
#ifndef CONFIG_UART3_SERIAL_CONSOLE
|
||||||
lpc17_uart3config(g_uart3priv.cclkdiv);
|
lpc17_uart3config(g_uart3priv.cclkdiv);
|
||||||
#endif
|
#endif
|
||||||
up_disableuartint(g_uart3priv.priv, NULL);
|
up_disableuartint(&g_uart3priv, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configuration whichever one is the console */
|
/* Configuration whichever one is the console */
|
||||||
|
|
Loading…
Reference in New Issue