Skip to content

Commit 2ac9894

Browse files
thinkyheadLCh-77
authored andcommitted
♻️ Apply F() to more LCD code (MarlinFirmware#24228)
1 parent 00c2dcc commit 2ac9894

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+636
-623
lines changed

Marlin/src/core/multi_language.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ typedef const char Language_Str[];
4545

4646
// Set unused languages equal to each other so the
4747
// compiler can optimize away the conditionals.
48+
#define LCD_LANGUAGE_1 LCD_LANGUAGE
4849
#ifndef LCD_LANGUAGE_2
4950
#define LCD_LANGUAGE_2 LCD_LANGUAGE
5051
#endif

Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

+20-20
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
410410

411411
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
412412
void lcd_scroll(const lcd_uint_t col, const lcd_uint_t line, FSTR_P const ftxt, const uint8_t len, const int16_t time) {
413-
uint8_t slen = utf8_strlen_P(FTOP(ftxt));
413+
uint8_t slen = utf8_strlen(ftxt);
414414
if (slen < len) {
415415
lcd_put_u8str_max(col, line, ftxt, len);
416416
for (; slen < len; ++slen) lcd_put_wchar(' ');
@@ -437,10 +437,10 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
437437
}
438438
}
439439

440-
static void logo_lines(PGM_P const extra) {
441-
int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2;
440+
static void logo_lines(FSTR_P const extra) {
441+
int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2;
442442
lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x01');
443-
lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str_P(extra);
443+
lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra);
444444
lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x03');
445445
}
446446

@@ -468,15 +468,15 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
468468
//
469469
// Show the Marlin logo, splash line1, and splash line 2
470470
//
471-
logo_lines(PSTR(" " SHORT_BUILD_VERSION));
471+
logo_lines(F(" " SHORT_BUILD_VERSION));
472472
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000);
473473
}
474474
else {
475475
//
476476
// Show the Marlin logo and short build version
477477
// After a delay show the website URL
478478
//
479-
logo_lines(NUL_STR);
479+
logo_lines(FPSTR(NUL_STR));
480480
CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
481481
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);
482482
#ifdef STRING_SPLASH_LINE3
@@ -1067,33 +1067,33 @@ void MarlinUI::draw_status_screen() {
10671067
#endif // ADVANCED_PAUSE_FEATURE
10681068

10691069
// Draw a static item with no left-right margin required. Centered by default.
1070-
void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
1070+
void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
10711071
int8_t n = LCD_WIDTH;
10721072
lcd_moveto(0, row);
1073-
const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0,
1073+
const int8_t plen = fstr ? utf8_strlen(fstr) : 0,
10741074
vlen = vstr ? utf8_strlen(vstr) : 0;
10751075
if (style & SS_CENTER) {
10761076
int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
10771077
while (--pad >= 0) { lcd_put_wchar(' '); n--; }
10781078
}
1079-
if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n);
1079+
if (plen) n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n);
10801080
if (vlen) n -= lcd_put_u8str_max(vstr, n);
10811081
for (; n > 0; --n) lcd_put_wchar(' ');
10821082
}
10831083

10841084
// Draw a generic menu item with pre_char (if selected) and post_char
1085-
void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) {
1085+
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) {
10861086
lcd_put_wchar(0, row, sel ? pre_char : ' ');
1087-
uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2);
1087+
uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2);
10881088
for (; n; --n) lcd_put_wchar(' ');
10891089
lcd_put_wchar(post_char);
10901090
}
10911091

10921092
// Draw a menu item with a (potentially) editable value
1093-
void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm) {
1093+
void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) {
10941094
const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0;
10951095
lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
1096-
uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen);
1096+
uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen);
10971097
if (vlen) {
10981098
lcd_put_wchar(':');
10991099
for (; n; --n) lcd_put_wchar(' ');
@@ -1102,9 +1102,9 @@ void MarlinUI::draw_status_screen() {
11021102
}
11031103

11041104
// Low-level draw_edit_screen can be used to draw an edit screen from anyplace
1105-
void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) {
1105+
void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
11061106
ui.encoder_direction_normal();
1107-
uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, itemString, LCD_WIDTH - 1);
1107+
uint8_t n = lcd_put_u8str_ind(0, 1, fstr, itemIndex, itemString, LCD_WIDTH - 1);
11081108
if (value) {
11091109
lcd_put_wchar(':'); n--;
11101110
const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space
@@ -1115,21 +1115,21 @@ void MarlinUI::draw_status_screen() {
11151115
}
11161116

11171117
// The Select Screen presents a prompt and two "buttons"
1118-
void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
1118+
void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) {
11191119
ui.draw_select_screen_prompt(pref, string, suff);
11201120
if (no) {
11211121
SETCURSOR(0, LCD_HEIGHT - 1);
1122-
lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']');
1122+
lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_wchar(yesno ? ' ' : ']');
11231123
}
11241124
if (yes) {
1125-
SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1);
1126-
lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd_put_wchar(yesno ? ']' : ' ');
1125+
SETCURSOR_RJ(utf8_strlen(yes) + 2, LCD_HEIGHT - 1);
1126+
lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd_put_wchar(yesno ? ']' : ' ');
11271127
}
11281128
}
11291129

11301130
#if ENABLED(SDSUPPORT)
11311131

1132-
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) {
1132+
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
11331133
lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
11341134
constexpr uint8_t maxlen = LCD_WIDTH - 2;
11351135
uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen);

Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp

+23-26
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,10 @@ void MarlinUI::clear_lcd() {
380380
void MarlinUI::_set_contrast() { lcd.setContrast(contrast); }
381381
#endif
382382

383-
static void center_text_P(PGM_P pstart, uint8_t y) {
384-
uint8_t len = utf8_strlen_P(pstart);
385-
if (len < LCD_WIDTH)
386-
lcd.setCursor((LCD_WIDTH - len) / 2, y);
387-
else
388-
lcd.setCursor(0, y);
389-
lcd_put_u8str_P(pstart);
383+
static void center_text(FSTR_P const fstart, const uint8_t y) {
384+
const uint8_t len = utf8_strlen(fstart);
385+
lcd.setCursor(len < LCD_WIDTH ? (LCD_WIDTH - len) / 2 : 0, y);
386+
lcd_put_u8str(fstart);
390387
}
391388

392389
#if ENABLED(SHOW_BOOTSCREEN)
@@ -402,8 +399,8 @@ static void center_text_P(PGM_P pstart, uint8_t y) {
402399
lcd.setCursor(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC);
403400
lcd.setCursor(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR);
404401
lcd.setCursor(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC);
405-
center_text_P(PSTR(SHORT_BUILD_VERSION), 3);
406-
center_text_P(PSTR(MARLIN_WEBSITE_URL), 4);
402+
center_text(F(SHORT_BUILD_VERSION), 3);
403+
center_text(F(MARLIN_WEBSITE_URL), 4);
407404
picBits = ICON_LOGO;
408405
lcd.print_screen();
409406
}
@@ -420,8 +417,8 @@ void MarlinUI::draw_kill_screen() {
420417
lcd.setCursor(0, 3); lcd.write(COLOR_ERROR);
421418
lcd.setCursor((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3);
422419
lcd_put_u8str(status_message);
423-
center_text_P(GET_TEXT(MSG_HALTED), 5);
424-
center_text_P(GET_TEXT(MSG_PLEASE_RESET), 6);
420+
center_text(GET_TEXT_F(MSG_HALTED), 5);
421+
center_text(GET_TEXT_F(MSG_PLEASE_RESET), 6);
425422
lcd.print_screen();
426423
}
427424

@@ -940,38 +937,38 @@ void MarlinUI::draw_status_screen() {
940937
#endif
941938

942939
// Draw a static item with no left-right margin required. Centered by default.
943-
void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) {
940+
void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) {
944941
if (!PanelDetected) return;
945942
uint8_t n = LCD_WIDTH;
946943
lcd.setCursor(0, row);
947944
if ((style & SS_CENTER) && !valstr) {
948-
int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2;
945+
int8_t pad = (LCD_WIDTH - utf8_strlen(fstr)) / 2;
949946
while (--pad >= 0) { lcd.write(' '); n--; }
950947
}
951-
n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n);
948+
n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n);
952949
if (valstr) n -= lcd_put_u8str_max(valstr, n);
953950
for (; n; --n) lcd.write(' ');
954951
lcd.print_line();
955952
}
956953

957954
// Draw a generic menu item with pre_char (if selected) and post_char
958-
void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) {
955+
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) {
959956
if (!PanelDetected) return;
960957
lcd.setCursor(0, row);
961958
lcd.write(sel ? pre_char : ' ');
962-
uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2);
959+
uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2);
963960
for (; n; --n) lcd.write(' ');
964961
lcd.write(post_char);
965962
lcd.print_line();
966963
}
967964

968965
// Draw a menu item with a (potentially) editable value
969-
void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const data, const bool pgm) {
966+
void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const data, const bool pgm) {
970967
if (!PanelDetected) return;
971968
const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0;
972969
lcd.setCursor(0, row);
973970
lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
974-
uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen);
971+
uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen);
975972
if (vlen) {
976973
lcd.write(':');
977974
for (; n; --n) lcd.write(' ');
@@ -982,13 +979,13 @@ void MarlinUI::draw_status_screen() {
982979

983980
// Low-level draw_edit_screen can be used to draw an edit screen from anyplace
984981
// This line moves to the last line of the screen for UBL plot screen on the panel side
985-
void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) {
982+
void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
986983
if (!PanelDetected) return;
987984
ui.encoder_direction_normal();
988985
const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y;
989986
lcd.setCursor(0, y);
990987
lcd.write(COLOR_EDIT);
991-
lcd_put_u8str_P(pstr);
988+
lcd_put_u8str(fstr);
992989
if (value) {
993990
lcd.write(':');
994991
lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces
@@ -1000,24 +997,24 @@ void MarlinUI::draw_status_screen() {
1000997
}
1001998

1002999
// The Select Screen presents a prompt and two "buttons"
1003-
void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) {
1000+
void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string, FSTR_P const suff) {
10041001
if (!PanelDetected) return;
10051002
ui.draw_select_screen_prompt(pref, string, suff);
10061003
lcd.write(COLOR_EDIT);
10071004
if (no) {
10081005
lcd.setCursor(0, MIDDLE_Y);
1009-
lcd.write(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd.write(yesno ? ' ' : ']');
1006+
lcd.write(yesno ? ' ' : '['); lcd_put_u8str(no); lcd.write(yesno ? ' ' : ']');
10101007
}
10111008
if (yes) {
1012-
lcd.setCursor(LCD_WIDTH - utf8_strlen_P(yes) - 3, MIDDLE_Y);
1013-
lcd.write(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd.write(yesno ? ']' : ' ');
1009+
lcd.setCursor(LCD_WIDTH - utf8_strlen(yes) - 3, MIDDLE_Y);
1010+
lcd.write(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd.write(yesno ? ']' : ' ');
10141011
}
10151012
lcd.print_line();
10161013
}
10171014

10181015
#if ENABLED(SDSUPPORT)
10191016

1020-
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) {
1017+
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
10211018
if (!PanelDetected) return;
10221019
lcd.setCursor(0, row);
10231020
lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
@@ -1081,7 +1078,7 @@ void MarlinUI::draw_status_screen() {
10811078
else
10821079
lcd_put_u8str(F(" -----"));
10831080

1084-
center_text_P(GET_TEXT(MSG_UBL_FINE_TUNE_MESH), 8);
1081+
center_text(GET_TEXT_F(MSG_UBL_FINE_TUNE_MESH), 8);
10851082

10861083
lcd.print_screen();
10871084
}

Marlin/src/lcd/dogm/marlinui_DOGM.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -412,42 +412,42 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
412412
}
413413

414414
// Draw a static line of text in the same idiom as a menu item
415-
void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
415+
void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
416416

417417
if (mark_as_selected(row, style & SS_INVERT)) {
418418
pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
419419

420-
const int plen = pstr ? calculateWidth(pstr) : 0,
420+
const int plen = fstr ? calculateWidth(FTOP(fstr)) : 0,
421421
vlen = vstr ? utf8_strlen(vstr) : 0;
422422
if (style & SS_CENTER) {
423423
int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2;
424424
while (--pad >= 0) n -= lcd_put_wchar(' ');
425425
}
426426

427-
if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
427+
if (plen) n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
428428
if (vlen) n -= lcd_put_u8str_max(vstr, n);
429429
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
430430
}
431431
}
432432

433433
// Draw a generic menu item
434-
void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) {
434+
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char, const char post_char) {
435435
if (mark_as_selected(row, sel)) {
436-
pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 1) * (MENU_FONT_WIDTH);
436+
pixel_len_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 1) * (MENU_FONT_WIDTH);
437437
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
438438
lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
439439
lcd_put_wchar(' ');
440440
}
441441
}
442442

443443
// Draw a menu item with an editable value
444-
void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm) {
444+
void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) {
445445
if (mark_as_selected(row, sel)) {
446446
const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)),
447447
pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr));
448448
const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
449449

450-
pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH);
450+
pixel_len_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH);
451451
if (vallen) {
452452
lcd_put_wchar(':');
453453
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
@@ -457,11 +457,11 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
457457
}
458458
}
459459

460-
void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) {
460+
void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
461461
ui.encoder_direction_normal();
462462

463463
const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
464-
const u8g_uint_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value);
464+
const u8g_uint_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value);
465465
bool extra_row = labellen * prop > LCD_WIDTH - 2 - vallen * prop;
466466

467467
#if ENABLED(USE_BIG_EDIT_FONT)
@@ -490,7 +490,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
490490

491491
// Assume the label is alpha-numeric (with a descender)
492492
bool onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline + EDIT_FONT_DESCENT);
493-
if (onpage) lcd_put_u8str_ind_P(0, baseline, pstr, itemIndex, itemString);
493+
if (onpage) lcd_put_u8str_ind(0, baseline, fstr, itemIndex, itemString);
494494

495495
// If a value is included, print a colon, then print the value right-justified
496496
if (value) {
@@ -508,8 +508,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
508508
TERN_(USE_BIG_EDIT_FONT, ui.set_font(FONT_MENU));
509509
}
510510

511-
inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) {
512-
const u8g_uint_t len = utf8_strlen_P(pstr),
511+
inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, FSTR_P const fstr, const bool inv) {
512+
const u8g_uint_t len = utf8_strlen(fstr),
513513
by = (y + 1) * (MENU_FONT_HEIGHT);
514514
const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
515515
const pixel_len_t bw = len * prop * (MENU_FONT_WIDTH), bx = x * prop * (MENU_FONT_WIDTH);
@@ -518,19 +518,19 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
518518
u8g.drawBox(bx / prop - 1, by - (MENU_FONT_ASCENT), bw + 2, MENU_FONT_HEIGHT);
519519
u8g.setColorIndex(0);
520520
}
521-
lcd_put_u8str_P(bx / prop, by, pstr);
521+
lcd_put_u8str(bx / prop, by, fstr);
522522
if (inv) u8g.setColorIndex(1);
523523
}
524524

525-
void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
525+
void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) {
526526
ui.draw_select_screen_prompt(pref, string, suff);
527527
if (no) draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno);
528-
if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno);
528+
if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno);
529529
}
530530

531531
#if ENABLED(SDSUPPORT)
532532

533-
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) {
533+
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
534534
if (mark_as_selected(row, sel)) {
535535
const uint8_t maxlen = LCD_WIDTH - isDir;
536536
if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);

0 commit comments

Comments
 (0)