summaryrefslogtreecommitdiff
path: root/nuttx/arch/c5471/src
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-14 18:58:21 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-14 18:58:21 +0000
commit78cbcfd2a16c0cf3763173ce0a14d656bede0135 (patch)
tree5fd6d76721ba77adb12c7fc265befb5cf264329f /nuttx/arch/c5471/src
parent9daf318dc8fbefa6d41c739fa53baa155b31887f (diff)
downloadpx4-nuttx-78cbcfd2a16c0cf3763173ce0a14d656bede0135.tar.gz
px4-nuttx-78cbcfd2a16c0cf3763173ce0a14d656bede0135.tar.bz2
px4-nuttx-78cbcfd2a16c0cf3763173ce0a14d656bede0135.zip
Add 8052 IRQ test; Fix places where IDLE task could try to wait on semaphoresnuttx-1.1
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@61 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/c5471/src')
-rw-r--r--nuttx/arch/c5471/src/up_serial.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/nuttx/arch/c5471/src/up_serial.c b/nuttx/arch/c5471/src/up_serial.c
index 022befd38..4b70ca4e2 100644
--- a/nuttx/arch/c5471/src/up_serial.c
+++ b/nuttx/arch/c5471/src/up_serial.c
@@ -837,15 +837,19 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen)
ssize_t ret = buflen;
/* We may receive console writes through this path from
- * interrupt handlers! In this case, we will need to do
- * things a little differently.
+ * interrupt handlers and from debug output in the IDLE task!
+ * In these cases, we will need to do things a little
+ * differently.
*/
- if (up_interrupt_context())
+ if (up_interrupt_context() || getpid() == 0)
{
if (dev->isconsole)
{
- return up_irqwrite(dev, buffer, buflen);
+ irqstate_t flags = irqsave();
+ ret = up_irqwrite(dev, buffer, buflen);
+ irqrestore(flags);
+ return ret;
}
else
{