[gnoduino: 17/237] Fixing race condition in Serial write (Brian Cook).
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino: 17/237] Fixing race condition in Serial write (Brian Cook).
- Date: Sat, 31 Mar 2012 20:16:15 +0000 (UTC)
commit a64f1914c010582abc356ffefb390e47e66ab9b3
Author: David A. Mellis <d mellis arduino cc>
Date: Sun Mar 6 11:47:18 2011 -0500
Fixing race condition in Serial write (Brian Cook).
arduino/cores/arduino/HardwareSerial.cpp | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/arduino/cores/arduino/HardwareSerial.cpp b/arduino/cores/arduino/HardwareSerial.cpp
index 1cd8cc5..6738675 100644
--- a/arduino/cores/arduino/HardwareSerial.cpp
+++ b/arduino/cores/arduino/HardwareSerial.cpp
@@ -367,7 +367,6 @@ void HardwareSerial::flush()
void HardwareSerial::write(uint8_t c)
{
- bool empty = (_tx_buffer->head == _tx_buffer->tail);
int i = (_tx_buffer->head + 1) % SERIAL_BUFFER_SIZE;
// If the output buffer is full, there's nothing for it other than to
@@ -378,11 +377,7 @@ void HardwareSerial::write(uint8_t c)
_tx_buffer->buffer[_tx_buffer->head] = c;
_tx_buffer->head = i;
- if (empty) {
- // The buffer was empty, so enable interrupt on
- // USART Data Register empty. The interrupt handler will take it from there
- sbi(*_ucsrb, _udrie);
- }
+ sbi(*_ucsrb, _udrie);
}
// Preinstantiate Objects //////////////////////////////////////////////////////
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]