Skip to content

Commit f11fcf6

Browse files
committed
Make the seperator configureable
Signed-off-by: Jan Losinski <[email protected]>
1 parent 017ffd0 commit f11fcf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/LineBufferProxy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <Print.h>
1414

15-
template <int Buffsize>
15+
template <int Buffsize, char Sep = '\n'>
1616
class LineBufferProxy : public Print {
1717
public:
1818
LineBufferProxy() : position(0) {}
@@ -21,7 +21,7 @@ class LineBufferProxy : public Print {
2121
buffer[position] = byte;
2222
position++;
2323

24-
if (position >= Buffsize || byte == '\n') {
24+
if (position >= Buffsize || byte == Sep) {
2525
doFlush();
2626
}
2727

@@ -36,7 +36,7 @@ class LineBufferProxy : public Print {
3636
bool newline = false;
3737
for (size_t i = 0; i < fit; ++i) {
3838
buffer[position + i] = incomming[start + i];
39-
if (incomming[i + start] == '\n') {
39+
if (incomming[i + start] == Sep) {
4040
newline = true;
4141
fit = i + 1;
4242
break;

0 commit comments

Comments
 (0)