File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 12
12
13
13
#include < Print.h>
14
14
15
- template <int Buffsize>
15
+ template <int Buffsize, char Sep = ' \n ' >
16
16
class LineBufferProxy : public Print {
17
17
public:
18
18
LineBufferProxy () : position(0 ) {}
@@ -21,7 +21,7 @@ class LineBufferProxy : public Print {
21
21
buffer[position] = byte;
22
22
position++;
23
23
24
- if (position >= Buffsize || byte == ' \n ' ) {
24
+ if (position >= Buffsize || byte == Sep ) {
25
25
doFlush ();
26
26
}
27
27
@@ -36,7 +36,7 @@ class LineBufferProxy : public Print {
36
36
bool newline = false ;
37
37
for (size_t i = 0 ; i < fit; ++i) {
38
38
buffer[position + i] = incomming[start + i];
39
- if (incomming[i + start] == ' \n ' ) {
39
+ if (incomming[i + start] == Sep ) {
40
40
newline = true ;
41
41
fit = i + 1 ;
42
42
break ;
You can’t perform that action at this time.
0 commit comments