Skip to content

Commit cb65ab3

Browse files
committed
Patch #2
1 parent e2225f5 commit cb65ab3

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

platformio.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ extra_scripts = pre:rename_usb_config.py
374374
extends = common:esp32
375375
board = adafruit_qtpy_esp32s3_n4r2
376376
build_flags = -DARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2 -DBOARD_HAS_PSRAM
377+
board_build.partitions = tinyuf2-partitions-4MB-noota.csv
377378
extra_scripts = pre:rename_usb_config.py
378379

379380
[env:adafruit_qtpy_esp32s3_with_psram_debug]

src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,19 @@ class WipperSnapper_I2C_Driver_Out_CharLcd
116116
for (int cur_col = 0; cur_col < _cols && cur_idx < message_length;
117117
cur_col++) {
118118
char c = message[cur_idx];
119+
WS_DEBUG_PRINTLN("CharLCD: Writing char: ");
120+
WS_DEBUG_PRINT(c);
121+
WS_DEBUG_PRINT(" | hex:0x");
122+
// print hex
123+
WS_DEBUG_PRINTHEX(c);
124+
WS_DEBUG_PRINTLN(" ");
119125
if (c == '\\' && cur_idx + 1 < message_length &&
120-
message[cur_idx + 1] == 'n') {
121-
cur_idx += 2; // Skip the '\n' character in the buffer
126+
(message[cur_idx + 1] == 'n' || message[cur_idx + 1] == 'r')) {
127+
cur_idx += 2; // Skip the '\n' or '\r' character in the buffer
128+
break; // and move to the next row
129+
} else if ((c == 0x0A || c == 0x0D) && cur_idx + 1 < message_length) {
130+
cur_idx += 1; // Skip the UTF-8 sequence for \n or \r
122131
break; // and move to the next row
123-
} else if (c == '\\' && cur_idx + 1 < message_length &&
124-
message[cur_idx + 1] == 'r') {
125-
cur_idx += 2; // Skip the '\r' character in the buffer
126-
continue; // and continue writing on the same row
127132
} else if (c == 194 && cur_idx + 1 < message_length &&
128133
message[cur_idx + 1] == 176) {
129134
cur_idx += 2; // Skip the degree symbol sequence in the buffer

0 commit comments

Comments
 (0)