aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/HardwareSerial.h
diff options
context:
space:
mode:
authorNico <NicoHood@users.noreply.github.com>2015-02-02 20:27:17 +0100
committerCristian Maglie <c.maglie@arduino.cc>2015-05-12 15:09:48 +0200
commit2e90af7ab6fa054a5c0a485624a650e4259fa184 (patch)
tree2bfec497909d060386928094abaee9cd8ce1c758 /cores/arduino/HardwareSerial.h
parentb682456e8e74dbbccb3e709b7838a8475902c00c (diff)
RX and TX Serial buffer sizes can now be defined independently
Fixes #2597
Diffstat (limited to 'cores/arduino/HardwareSerial.h')
-rw-r--r--cores/arduino/HardwareSerial.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h
index 7dc2aa9..7f4f162 100644
--- a/cores/arduino/HardwareSerial.h
+++ b/cores/arduino/HardwareSerial.h
@@ -34,12 +34,17 @@
// location from which to read.
// NOTE: a "power of 2" buffer size is reccomended to dramatically
// optimize all the modulo operations for ring buffers.
-#if !(defined(SERIAL_TX_BUFFER_SIZE) && defined(SERIAL_RX_BUFFER_SIZE))
+#if !defined(SERIAL_TX_BUFFER_SIZE)
#if (RAMEND < 1000)
#define SERIAL_TX_BUFFER_SIZE 16
-#define SERIAL_RX_BUFFER_SIZE 16
#else
#define SERIAL_TX_BUFFER_SIZE 64
+#endif
+#endif
+#if !defined(SERIAL_RX_BUFFER_SIZE)
+#if (RAMEND < 1000)
+#define SERIAL_RX_BUFFER_SIZE 16
+#else
#define SERIAL_RX_BUFFER_SIZE 64
#endif
#endif