Fix com.c logic error
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3600 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
fd69ba1da6
commit
3e1e4f6876
@ -485,11 +485,14 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
|
|||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||||
uint16_t base = priv->base;
|
uint16_t base = priv->base;
|
||||||
|
irqstate_t flags;
|
||||||
uint8_t ier;
|
uint8_t ier;
|
||||||
|
|
||||||
|
flags = irqsave();
|
||||||
ier = inb(base+COM_IER);
|
ier = inb(base+COM_IER);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
ier |= COM_IER_TEI;
|
ier |= COM_IER_TEI;
|
||||||
|
outb(base+COM_IER, ier);
|
||||||
|
|
||||||
/* Fake a TX interrupt here by just calling uart_xmitchars() with
|
/* Fake a TX interrupt here by just calling uart_xmitchars() with
|
||||||
* interrupts disabled (note this may recurse).
|
* interrupts disabled (note this may recurse).
|
||||||
@ -499,8 +502,9 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ier &= ~COM_IER_TEI;
|
ier &= ~COM_IER_TEI;
|
||||||
|
outb(base+COM_IER, ier);
|
||||||
}
|
}
|
||||||
outb(base+COM_IER, ier);
|
irqrestore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user