aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/HardwareSerial.h
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2011-03-05 14:17:26 -0500
committerDavid A. Mellis <d.mellis@arduino.cc>2011-03-05 14:17:26 -0500
commitd8d233ad3e4513cb5378dca459c251e0a127e129 (patch)
treeab79a29fce5a3fc653467e5b8669e72864663d11 /cores/arduino/HardwareSerial.h
parenta19a23ff92bffd2d32fa2c2c84026bdfd711c6ac (diff)
Implemented serial transmit buffering.
Now Serial.write() places characters in the transmit buffer, and the data register empty interrupt reads and transmit them. Based loosely on the implementation here: ftp://wookey.org.uk/arduino. http://code.google.com/p/arduino/issues/detail?id=262
Diffstat (limited to 'cores/arduino/HardwareSerial.h')
-rw-r--r--cores/arduino/HardwareSerial.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h
index 3efa775..d229373 100644
--- a/cores/arduino/HardwareSerial.h
+++ b/cores/arduino/HardwareSerial.h
@@ -32,6 +32,7 @@ class HardwareSerial : public Stream
{
private:
ring_buffer *_rx_buffer;
+ ring_buffer *_tx_buffer;
volatile uint8_t *_ubrrh;
volatile uint8_t *_ubrrl;
volatile uint8_t *_ucsra;
@@ -40,14 +41,14 @@ class HardwareSerial : public Stream
uint8_t _rxen;
uint8_t _txen;
uint8_t _rxcie;
- uint8_t _udre;
+ uint8_t _udrie;
uint8_t _u2x;
public:
- HardwareSerial(ring_buffer *rx_buffer,
+ HardwareSerial(ring_buffer *rx_buffer, ring_buffer *tx_buffer,
volatile uint8_t *ubrrh, volatile uint8_t *ubrrl,
volatile uint8_t *ucsra, volatile uint8_t *ucsrb,
volatile uint8_t *udr,
- uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x);
+ uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udrie, uint8_t u2x);
void begin(long);
void end();
virtual int available(void);