Correct undefined Serial Buffer Size

https://github.com/arduino/Arduino/pull/2597
This commit is contained in:
Nico 2015-02-02 20:36:12 +01:00
parent 68cc2c9faa
commit e6642ca0dc
3 changed files with 13 additions and 4 deletions

3
.gitignore vendored
View file

@ -1,2 +1 @@
dev/*
*.pdn
dev/*

View file

@ -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

View file

@ -56,11 +56,16 @@ THE SOFTWARE.
struct ring_buffer;
#ifndef SERIAL_BUFFER_SIZE
#if (RAMEND < 1000)
#define SERIAL_BUFFER_SIZE 16
#else
#define SERIAL_BUFFER_SIZE 64
#endif
#endif
#if (SERIAL_BUFFER_SIZE>256)
#error Please lower the CDC Buffer size
#endif
class Serial_ : public Stream
{