From fd831038f69a0356dd3eda644ea54da42d85fee1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 20 Sep 2008 16:24:14 +0000 Subject: [PATCH] Fix initiali interrupt issue git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@947 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/src/lpc214x/lpc214x_serial.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/lpc214x/lpc214x_serial.c b/arch/arm/src/lpc214x/lpc214x_serial.c index 84de77ff5c..b2817dbc9d 100644 --- a/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/arch/arm/src/lpc214x/lpc214x_serial.c @@ -61,8 +61,6 @@ * Definitions ****************************************************************************/ -#define BASE_BAUD 38400 - /**************************************************************************** * Private Types ****************************************************************************/ @@ -356,6 +354,15 @@ static int up_setup(struct uart_dev_s *dev) up_serialout(priv, LPC214X_UART_FCR_OFFSET, (LPC214X_FCR_FIFO_TRIG8|LPC214X_FCR_TX_FIFO_RESET|\ LPC214X_FCR_RX_FIFO_RESET|LPC214X_FCR_FIFO_ENABLE)); + + /* The NuttX serial driver waits for the first THRE interrrupt before + * sending serial data... However, it appears that the lpc214x hardware + * does not generate that interrupt until a transition from not-empty + * to empty. So, the current kludge here is to send one NULL at + * startup to kick things off. + */ + + up_serialout(priv, LPC214X_UART_THR_OFFSET, '\0'); #endif return OK; }