diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-06-13 16:18:25 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-06-13 16:18:25 -0600 |
commit | f89052fa018e2b4e3ae7aeea2f36aa3d08927956 (patch) | |
tree | 8803293b855c7a9f6fa848692dc945aff581e21f /nuttx/drivers/serial | |
parent | 59868bc1000ec7173ac4b18fa239a5d662ed72c4 (diff) | |
download | px4-nuttx-f89052fa018e2b4e3ae7aeea2f36aa3d08927956.tar.gz px4-nuttx-f89052fa018e2b4e3ae7aeea2f36aa3d08927956.tar.bz2 px4-nuttx-f89052fa018e2b4e3ae7aeea2f36aa3d08927956.zip |
SAM3/4: Loop counter for PLL delay must be volatile or it may get optimized away
Diffstat (limited to 'nuttx/drivers/serial')
-rw-r--r-- | nuttx/drivers/serial/serialirq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nuttx/drivers/serial/serialirq.c b/nuttx/drivers/serial/serialirq.c index fda5b4afb..8e3f80ead 100644 --- a/nuttx/drivers/serial/serialirq.c +++ b/nuttx/drivers/serial/serialirq.c @@ -84,7 +84,7 @@ void uart_xmitchars(FAR uart_dev_t *dev) { uint16_t nbytes = 0; - /* Send while we still have data & room in the fifo */ + /* Send while we still have data in the TX buffer & room in the fifo */ while (dev->xmit.head != dev->xmit.tail && uart_txready(dev)) { @@ -103,6 +103,11 @@ void uart_xmitchars(FAR uart_dev_t *dev) /* When all of the characters have been sent from the buffer disable the TX * interrupt. + * + * Potential bug? If nbytes == 0 && (dev->xmit.head == dev->xmit.tail) && + * dev->xmitwaiting == true, then disabling the TX interrupt will leave + * the uart_write() logic waiting to TX to complete with no TX interrupts. + * Can that happen? */ if (dev->xmit.head == dev->xmit.tail) |