summaryrefslogtreecommitdiff
path: root/nuttx/arch/c5471/src/up_serial.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-08 22:34:02 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-08 22:34:02 +0000
commit49737fea1face763babc39b5b6a547157d7131f0 (patch)
treef2fa344d78e3a37689a7fc509c37f393295198ee /nuttx/arch/c5471/src/up_serial.c
parenta8872bea509f507b8f595e210e49fd06d8aa0d49 (diff)
downloadpx4-nuttx-49737fea1face763babc39b5b6a547157d7131f0.tar.gz
px4-nuttx-49737fea1face763babc39b5b6a547157d7131f0.tar.bz2
px4-nuttx-49737fea1face763babc39b5b6a547157d7131f0.zip
Fixed some interrupt-related bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@45 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/c5471/src/up_serial.c')
-rw-r--r--nuttx/arch/c5471/src/up_serial.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/nuttx/arch/c5471/src/up_serial.c b/nuttx/arch/c5471/src/up_serial.c
index d0d5ed6ba..8ab1d6954 100644
--- a/nuttx/arch/c5471/src/up_serial.c
+++ b/nuttx/arch/c5471/src/up_serial.c
@@ -252,14 +252,18 @@ static inline void up_disablerxint(up_dev_t *dev)
static inline void up_enabletxint(up_dev_t *dev)
{
+#ifndef CONFIG_SUPPRESS_SERIAL_INTS
dev->regs.ier |= UART_IER_XmitInt;
up_serialout(dev, UART_IER_OFFS, dev->regs.ier);
+#endif
}
static inline void up_enablerxint(up_dev_t *dev)
{
+#ifndef CONFIG_SUPPRESS_SERIAL_INTS
dev->regs.ier |= UART_IER_RecvInt;
up_serialout(dev, UART_IER_OFFS, dev->regs.ier);
+#endif
}
static inline void up_disableuartint(up_dev_t *dev, uint16 *ier)
@@ -617,7 +621,7 @@ static void up_putxmitchar(up_dev_t *dev, int ch)
{
/* Still no space */
-#ifdef CONFIG_SUPPRESS_INTERRUPTS
+#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS)
up_waittxfifonotfull(dev);
#else
dev->xmitwaiting = TRUE;
@@ -876,7 +880,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen)
}
}
- up_enabletxint(dev);
+ up_enablerxint(dev);
return ret;
}
@@ -1026,8 +1030,10 @@ static int up_open(struct file *filep)
/* Attache and enabled the IRQ */
+#ifndef CONFIG_SUPPRESS_SERIAL_INTS
ret = irq_attach(dev->irq, up_interrupt);
if (ret == OK)
+#endif
{
/* Mark the io buffers empty */
@@ -1038,7 +1044,9 @@ static int up_open(struct file *filep)
/* Finally, enable interrupts */
+#ifndef CONFIG_SUPPRESS_SERIAL_INTS
up_enable_irq(dev->irq);
+#endif
up_enablerxint(dev);
}
irqrestore(flags);