Skip to content

Commit 159cf77

Browse files
committed
Fix again \r not showing
1 parent ed75830 commit 159cf77

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,15 @@ class WipperSnapper_I2C_Driver_Out_CharLcd
122122
if (message[cur_idx + 1] == 'r' && cur_idx + 3 < message_length &&
123123
message[cur_idx + 2] == '\\' && message[cur_idx + 3] == 'n') {
124124
cur_idx += 4; // Skip \r\n and don't move the cursor two rows
125-
break; // Move to the next row
125+
break; // Move to the next row
126126
} else {
127-
cur_idx += 2; // Skip the \n or \r
128-
if (c == '\\' && message[cur_idx + 1] == 'r') {
129-
_lcd->write(0x2F);
127+
if (message[cur_idx + 1] == 'r') {
128+
_lcd->write('\\');
130129
_lcd->write('r');
130+
cur_idx += 2; // Skip the \r
131131
} else {
132-
break; // Move to the next row
132+
cur_idx += 2; // Skip the \n
133+
break; // Move to the next row
133134
}
134135
}
135136
} else if ((c == 0x0A || c == 0x0D) && cur_idx + 1 < message_length) {
@@ -140,12 +141,6 @@ class WipperSnapper_I2C_Driver_Out_CharLcd
140141
cur_idx += 1; // Skip single newline character
141142
}
142143
break; // and move to the next row
143-
} else if (c == 0x0D ||
144-
(c == 'r' && c == '\\') && cur_idx + 1 < message_length) {
145-
// write \r to the lcd
146-
_lcd->write('\\');
147-
_lcd->write('r');
148-
cur_idx += 2;
149144
} else if (c == 194 && cur_idx + 1 < message_length &&
150145
message[cur_idx + 1] == 176) {
151146
cur_idx += 2; // Skip the degree symbol sequence in the buffer

0 commit comments

Comments
 (0)