Skip to content

Commit ef20d77

Browse files
committed
Fix HW Serial buffer size determination
1 parent f8c6640 commit ef20d77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arduino/avr/cores/arduino/HardwareSerial.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
// often work, but occasionally a race condition can occur that makes
4141
// Serial behave erratically. See https://github.com/arduino/Arduino/issues/2405
4242
#if !defined(SERIAL_TX_BUFFER_SIZE)
43-
#if (RAMEND < 1000)
43+
#if ((RAMEND - RAMSTART) < 1023)
4444
#define SERIAL_TX_BUFFER_SIZE 16
4545
#else
4646
#define SERIAL_TX_BUFFER_SIZE 64
4747
#endif
4848
#endif
4949
#if !defined(SERIAL_RX_BUFFER_SIZE)
50-
#if (RAMEND < 1000)
50+
#if ((RAMEND - RAMSTART) < 1023)
5151
#define SERIAL_RX_BUFFER_SIZE 16
5252
#else
5353
#define SERIAL_RX_BUFFER_SIZE 64

0 commit comments

Comments
 (0)