@@ -410,7 +410,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
410
410
411
411
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
412
412
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);
414
414
if (slen < len) {
415
415
lcd_put_u8str_max (col, line, ftxt, len);
416
416
for (; slen < len; ++slen) lcd_put_wchar (' ' );
@@ -437,10 +437,10 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
437
437
}
438
438
}
439
439
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 ;
442
442
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);
444
444
lcd_put_wchar (indent, 2 , ' \x02 ' ); lcd_put_u8str (F ( " ------" )); lcd_put_wchar (' \x03 ' );
445
445
}
446
446
@@ -468,15 +468,15 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
468
468
//
469
469
// Show the Marlin logo, splash line1, and splash line 2
470
470
//
471
- logo_lines (PSTR (" " SHORT_BUILD_VERSION));
471
+ logo_lines (F (" " SHORT_BUILD_VERSION));
472
472
CENTER_OR_SCROLL (MARLIN_WEBSITE_URL, 2000 );
473
473
}
474
474
else {
475
475
//
476
476
// Show the Marlin logo and short build version
477
477
// After a delay show the website URL
478
478
//
479
- logo_lines (NUL_STR);
479
+ logo_lines (FPSTR ( NUL_STR) );
480
480
CENTER_OR_SCROLL (SHORT_BUILD_VERSION, 1500 );
481
481
CENTER_OR_SCROLL (MARLIN_WEBSITE_URL, 1500 );
482
482
#ifdef STRING_SPLASH_LINE3
@@ -1067,33 +1067,33 @@ void MarlinUI::draw_status_screen() {
1067
1067
#endif // ADVANCED_PAUSE_FEATURE
1068
1068
1069
1069
// 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*/ ) {
1071
1071
int8_t n = LCD_WIDTH;
1072
1072
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 ,
1074
1074
vlen = vstr ? utf8_strlen (vstr) : 0 ;
1075
1075
if (style & SS_CENTER) {
1076
1076
int8_t pad = (LCD_WIDTH - plen - vlen) / 2 ;
1077
1077
while (--pad >= 0 ) { lcd_put_wchar (' ' ); n--; }
1078
1078
}
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);
1080
1080
if (vlen) n -= lcd_put_u8str_max (vstr, n);
1081
1081
for (; n > 0 ; --n) lcd_put_wchar (' ' );
1082
1082
}
1083
1083
1084
1084
// 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) {
1086
1086
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 );
1088
1088
for (; n; --n) lcd_put_wchar (' ' );
1089
1089
lcd_put_wchar (post_char);
1090
1090
}
1091
1091
1092
1092
// 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) {
1094
1094
const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P (inStr) : utf8_strlen (inStr)) : 0 ;
1095
1095
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);
1097
1097
if (vlen) {
1098
1098
lcd_put_wchar (' :' );
1099
1099
for (; n; --n) lcd_put_wchar (' ' );
@@ -1102,9 +1102,9 @@ void MarlinUI::draw_status_screen() {
1102
1102
}
1103
1103
1104
1104
// 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*/ ) {
1106
1106
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 );
1108
1108
if (value) {
1109
1109
lcd_put_wchar (' :' ); n--;
1110
1110
const uint8_t len = utf8_strlen (value) + 1 ; // Plus one for a leading space
@@ -1115,21 +1115,21 @@ void MarlinUI::draw_status_screen() {
1115
1115
}
1116
1116
1117
1117
// 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*/ ) {
1119
1119
ui.draw_select_screen_prompt (pref, string, suff);
1120
1120
if (no) {
1121
1121
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 ? ' ' : ' ]' );
1123
1123
}
1124
1124
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 ? ' ]' : ' ' );
1127
1127
}
1128
1128
}
1129
1129
1130
1130
#if ENABLED(SDSUPPORT)
1131
1131
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) {
1133
1133
lcd_put_wchar (0 , row, sel ? LCD_STR_ARROW_RIGHT[0 ] : ' ' );
1134
1134
constexpr uint8_t maxlen = LCD_WIDTH - 2 ;
1135
1135
uint8_t n = maxlen - lcd_put_u8str_max (ui.scrolled_filename (theCard, maxlen, row, sel), maxlen);
0 commit comments