File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 34
34
// location from which to read.
35
35
// NOTE: a "power of 2" buffer size is reccomended to dramatically
36
36
// 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)
38
38
#if (RAMEND < 1000)
39
39
#define SERIAL_TX_BUFFER_SIZE 16
40
- #define SERIAL_RX_BUFFER_SIZE 16
41
40
#else
42
41
#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
43
48
#define SERIAL_RX_BUFFER_SIZE 64
44
49
#endif
45
50
#endif
Original file line number Diff line number Diff line change @@ -59,11 +59,16 @@ extern USBDevice_ USBDevice;
59
59
60
60
struct ring_buffer ;
61
61
62
+ #ifndef SERIAL_BUFFER_SIZE
62
63
#if (RAMEND < 1000)
63
64
#define SERIAL_BUFFER_SIZE 16
64
65
#else
65
66
#define SERIAL_BUFFER_SIZE 64
66
67
#endif
68
+ #endif
69
+ #if (SERIAL_BUFFER_SIZE>256)
70
+ #error Please lower the CDC Buffer size
71
+ #endif
67
72
68
73
class Serial_ : public Stream
69
74
{
You can’t perform that action at this time.
0 commit comments