aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-12-23 00:00:17 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-12-23 00:00:17 +0000
commitfe28586154ac07105f22408619199a7b05dee389 (patch)
tree8d07529b88913d3b9eb0af48a61155bff60f7d04
parent7ea4cb39bd8b4bf57c43acc50310bcb7402e3552 (diff)
Adding Serial.end().
-rwxr-xr-xcores/arduino/HardwareSerial.cpp7
-rwxr-xr-xcores/arduino/HardwareSerial.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp
index 1af6a66..712a4c7 100755
--- a/cores/arduino/HardwareSerial.cpp
+++ b/cores/arduino/HardwareSerial.cpp
@@ -165,6 +165,13 @@ void HardwareSerial::begin(long baud)
sbi(*_ucsrb, _rxcie);
}
+void HardwareSerial::end()
+{
+ cbi(*_ucsrb, _rxen);
+ cbi(*_ucsrb, _txen);
+ cbi(*_ucsrb, _rxcie);
+}
+
uint8_t HardwareSerial::available(void)
{
return (RX_BUFFER_SIZE + _rx_buffer->head - _rx_buffer->tail) % RX_BUFFER_SIZE;
diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h
index f975ccd..6b620ed 100755
--- a/cores/arduino/HardwareSerial.h
+++ b/cores/arduino/HardwareSerial.h
@@ -47,6 +47,7 @@ class HardwareSerial : public Print
volatile uint8_t *udr,
uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x);
void begin(long);
+ void end();
uint8_t available(void);
int read(void);
void flush(void);