From edcfdba42da5a02b8af9152591999323260b4425 Mon Sep 17 00:00:00 2001 From: Nico Date: Sun, 20 Sep 2015 11:07:19 +0200 Subject: Fix HW Serial buffer size determination --- cores/arduino/HardwareSerial.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h index 1beafc5..8a5bf95 100644 --- a/cores/arduino/HardwareSerial.h +++ b/cores/arduino/HardwareSerial.h @@ -40,14 +40,14 @@ // often work, but occasionally a race condition can occur that makes // Serial behave erratically. See https://github.com/arduino/Arduino/issues/2405 #if !defined(SERIAL_TX_BUFFER_SIZE) -#if (RAMEND < 1000) +#if ((RAMEND - RAMSTART) < 1023) #define SERIAL_TX_BUFFER_SIZE 16 #else #define SERIAL_TX_BUFFER_SIZE 64 #endif #endif #if !defined(SERIAL_RX_BUFFER_SIZE) -#if (RAMEND < 1000) +#if ((RAMEND - RAMSTART) < 1023) #define SERIAL_RX_BUFFER_SIZE 16 #else #define SERIAL_RX_BUFFER_SIZE 64 -- cgit v1.2.3-18-g5258 From 7f2ca6ee281fe12e8f25e71cf59f561e81e63fd8 Mon Sep 17 00:00:00 2001 From: Nico Date: Sun, 20 Sep 2015 11:08:49 +0200 Subject: Fix CDC Serial buffer size determination --- cores/arduino/USBAPI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index 4072772..f22ab6a 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -75,7 +75,7 @@ extern USBDevice_ USBDevice; struct ring_buffer; #ifndef SERIAL_BUFFER_SIZE -#if (RAMEND < 1000) +#if ((RAMEND - RAMSTART) < 1023) #define SERIAL_BUFFER_SIZE 16 #else #define SERIAL_BUFFER_SIZE 64 -- cgit v1.2.3-18-g5258