File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
hardware/arduino/avr/cores/arduino Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3434// location from which to read.
3535// NOTE: a "power of 2" buffer size is reccomended to dramatically
3636// optimize all the modulo operations for ring buffers.
37- #if !( defined(SERIAL_TX_BUFFER_SIZE) && defined(SERIAL_RX_BUFFER_SIZE) )
37+ #if !defined(SERIAL_TX_BUFFER_SIZE)
3838#if (RAMEND < 1000)
3939#define SERIAL_TX_BUFFER_SIZE 16
40- #define SERIAL_RX_BUFFER_SIZE 16
4140#else
4241#define SERIAL_TX_BUFFER_SIZE 64
42+ #endif
43+ #endif
44+ #if !defined(SERIAL_RX_BUFFER_SIZE)
45+ #if (RAMEND < 1000)
46+ #define SERIAL_RX_BUFFER_SIZE 16
47+ #else
4348#define SERIAL_RX_BUFFER_SIZE 64
4449#endif
4550#endif
Original file line number Diff line number Diff line change @@ -59,11 +59,16 @@ extern USBDevice_ USBDevice;
5959
6060struct ring_buffer ;
6161
62+ #ifndef SERIAL_BUFFER_SIZE
6263#if (RAMEND < 1000)
6364#define SERIAL_BUFFER_SIZE 16
6465#else
6566#define SERIAL_BUFFER_SIZE 64
6667#endif
68+ #endif
69+ #if (SERIAL_BUFFER_SIZE>256)
70+ #error Please lower the CDC Buffer size
71+ #endif
6772
6873class Serial_ : public Stream
6974{
You can’t perform that action at this time.
0 commit comments