Bläddra i källkod

♻️ Apply F() to more LCD code (#24228)

Scott Lahteine 2 år sedan
förälder
incheckning
a5e1d4c50a
Inget konto är kopplat till bidragsgivarens mejladress
44 ändrade filer med 636 tillägg och 623 borttagningar
  1. 1
    0
      Marlin/src/core/multi_language.h
  2. 20
    20
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
  3. 23
    26
      Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
  4. 16
    16
      Marlin/src/lcd/dogm/marlinui_DOGM.cpp
  5. 6
    6
      Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp
  6. 1
    1
      Marlin/src/lcd/e3v2/common/dwin_api.h
  7. 2
    2
      Marlin/src/lcd/e3v2/jyersui/dwin.cpp
  8. 4
    4
      Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp
  9. 9
    4
      Marlin/src/lcd/e3v2/marlinui/dwin_string.h
  10. 18
    18
      Marlin/src/lcd/e3v2/marlinui/ui_common.cpp
  11. 1
    1
      Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp
  12. 24
    24
      Marlin/src/lcd/marlinui.cpp
  13. 3
    3
      Marlin/src/lcd/marlinui.h
  14. 10
    10
      Marlin/src/lcd/menu/menu.cpp
  15. 30
    26
      Marlin/src/lcd/menu/menu.h
  16. 2
    2
      Marlin/src/lcd/menu/menu_advanced.cpp
  17. 9
    9
      Marlin/src/lcd/menu/menu_bed_corners.cpp
  18. 7
    7
      Marlin/src/lcd/menu/menu_bed_leveling.cpp
  19. 1
    1
      Marlin/src/lcd/menu/menu_cancelobject.cpp
  20. 25
    25
      Marlin/src/lcd/menu/menu_configuration.cpp
  21. 3
    3
      Marlin/src/lcd/menu/menu_delta_calibrate.cpp
  22. 52
    52
      Marlin/src/lcd/menu/menu_filament.cpp
  23. 28
    28
      Marlin/src/lcd/menu/menu_info.cpp
  24. 122
    122
      Marlin/src/lcd/menu/menu_item.h
  25. 5
    5
      Marlin/src/lcd/menu/menu_language.cpp
  26. 28
    28
      Marlin/src/lcd/menu/menu_main.cpp
  27. 13
    13
      Marlin/src/lcd/menu/menu_media.cpp
  28. 5
    5
      Marlin/src/lcd/menu/menu_mixer.cpp
  29. 53
    53
      Marlin/src/lcd/menu/menu_motion.cpp
  30. 6
    6
      Marlin/src/lcd/menu/menu_password.cpp
  31. 5
    5
      Marlin/src/lcd/menu/menu_probe_offset.cpp
  32. 1
    1
      Marlin/src/lcd/menu/menu_spindle_laser.cpp
  33. 4
    4
      Marlin/src/lcd/menu/menu_tmc.cpp
  34. 1
    1
      Marlin/src/lcd/menu/menu_tramming.cpp
  35. 5
    5
      Marlin/src/lcd/menu/menu_tune.cpp
  36. 29
    29
      Marlin/src/lcd/menu/menu_ubl.cpp
  37. 9
    9
      Marlin/src/lcd/menu/menu_x_twist.cpp
  38. 4
    4
      Marlin/src/lcd/tft/tft_string.cpp
  39. 9
    3
      Marlin/src/lcd/tft/tft_string.h
  40. 9
    9
      Marlin/src/lcd/tft/touch.cpp
  41. 11
    11
      Marlin/src/lcd/tft/ui_1024x600.cpp
  42. 7
    7
      Marlin/src/lcd/tft/ui_320x240.cpp
  43. 7
    7
      Marlin/src/lcd/tft/ui_480x320.cpp
  44. 8
    8
      Marlin/src/lcd/tft/ui_common.cpp

+ 1
- 0
Marlin/src/core/multi_language.h Visa fil

45
 
45
 
46
 // Set unused languages equal to each other so the
46
 // Set unused languages equal to each other so the
47
 // compiler can optimize away the conditionals.
47
 // compiler can optimize away the conditionals.
48
+#define LCD_LANGUAGE_1 LCD_LANGUAGE
48
 #ifndef LCD_LANGUAGE_2
49
 #ifndef LCD_LANGUAGE_2
49
   #define LCD_LANGUAGE_2 LCD_LANGUAGE
50
   #define LCD_LANGUAGE_2 LCD_LANGUAGE
50
 #endif
51
 #endif

+ 20
- 20
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp Visa fil

410
 
410
 
411
   // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
411
   // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
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) {
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
     if (slen < len) {
414
     if (slen < len) {
415
       lcd_put_u8str_max(col, line, ftxt, len);
415
       lcd_put_u8str_max(col, line, ftxt, len);
416
       for (; slen < len; ++slen) lcd_put_wchar(' ');
416
       for (; slen < len; ++slen) lcd_put_wchar(' ');
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
     lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" ));  lcd_put_wchar('\x01');
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
     lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" ));  lcd_put_wchar('\x03');
444
     lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" ));  lcd_put_wchar('\x03');
445
   }
445
   }
446
 
446
 
468
       //
468
       //
469
       // Show the Marlin logo, splash line1, and splash line 2
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
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000);
472
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000);
473
     }
473
     }
474
     else {
474
     else {
476
       // Show the Marlin logo and short build version
476
       // Show the Marlin logo and short build version
477
       // After a delay show the website URL
477
       // After a delay show the website URL
478
       //
478
       //
479
-      logo_lines(NUL_STR);
479
+      logo_lines(FPSTR(NUL_STR));
480
       CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
480
       CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
481
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);
481
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);
482
       #ifdef STRING_SPLASH_LINE3
482
       #ifdef STRING_SPLASH_LINE3
1067
   #endif // ADVANCED_PAUSE_FEATURE
1067
   #endif // ADVANCED_PAUSE_FEATURE
1068
 
1068
 
1069
   // Draw a static item with no left-right margin required. Centered by default.
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
     int8_t n = LCD_WIDTH;
1071
     int8_t n = LCD_WIDTH;
1072
     lcd_moveto(0, row);
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
                  vlen = vstr ? utf8_strlen(vstr) : 0;
1074
                  vlen = vstr ? utf8_strlen(vstr) : 0;
1075
     if (style & SS_CENTER) {
1075
     if (style & SS_CENTER) {
1076
       int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
1076
       int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
1077
       while (--pad >= 0) { lcd_put_wchar(' '); n--; }
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
     if (vlen) n -= lcd_put_u8str_max(vstr, n);
1080
     if (vlen) n -= lcd_put_u8str_max(vstr, n);
1081
     for (; n > 0; --n) lcd_put_wchar(' ');
1081
     for (; n > 0; --n) lcd_put_wchar(' ');
1082
   }
1082
   }
1083
 
1083
 
1084
   // Draw a generic menu item with pre_char (if selected) and post_char
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
     lcd_put_wchar(0, row, sel ? pre_char : ' ');
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
     for (; n; --n) lcd_put_wchar(' ');
1088
     for (; n; --n) lcd_put_wchar(' ');
1089
     lcd_put_wchar(post_char);
1089
     lcd_put_wchar(post_char);
1090
   }
1090
   }
1091
 
1091
 
1092
   // Draw a menu item with a (potentially) editable value
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
     const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0;
1094
     const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0;
1095
     lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
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
     if (vlen) {
1097
     if (vlen) {
1098
       lcd_put_wchar(':');
1098
       lcd_put_wchar(':');
1099
       for (; n; --n) lcd_put_wchar(' ');
1099
       for (; n; --n) lcd_put_wchar(' ');
1102
   }
1102
   }
1103
 
1103
 
1104
   // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
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
     ui.encoder_direction_normal();
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
     if (value) {
1108
     if (value) {
1109
       lcd_put_wchar(':'); n--;
1109
       lcd_put_wchar(':'); n--;
1110
       const uint8_t len = utf8_strlen(value) + 1;   // Plus one for a leading space
1110
       const uint8_t len = utf8_strlen(value) + 1;   // Plus one for a leading space
1115
   }
1115
   }
1116
 
1116
 
1117
   // The Select Screen presents a prompt and two "buttons"
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
     ui.draw_select_screen_prompt(pref, string, suff);
1119
     ui.draw_select_screen_prompt(pref, string, suff);
1120
     if (no) {
1120
     if (no) {
1121
       SETCURSOR(0, LCD_HEIGHT - 1);
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
     if (yes) {
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
   #if ENABLED(SDSUPPORT)
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
       lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
1133
       lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
1134
       constexpr uint8_t maxlen = LCD_WIDTH - 2;
1134
       constexpr uint8_t maxlen = LCD_WIDTH - 2;
1135
       uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen);
1135
       uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen);

+ 23
- 26
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp Visa fil

380
   void MarlinUI::_set_contrast() { lcd.setContrast(contrast); }
380
   void MarlinUI::_set_contrast() { lcd.setContrast(contrast); }
381
 #endif
381
 #endif
382
 
382
 
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);
390
 }
387
 }
391
 
388
 
392
 #if ENABLED(SHOW_BOOTSCREEN)
389
 #if ENABLED(SHOW_BOOTSCREEN)
402
     lcd.setCursor(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------"));  lcd.write(TRC);
399
     lcd.setCursor(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------"));  lcd.write(TRC);
403
     lcd.setCursor(indent, 1); lcd.write(LR);  lcd_put_u8str(F("Marlin"));  lcd.write(LR);
400
     lcd.setCursor(indent, 1); lcd.write(LR);  lcd_put_u8str(F("Marlin"));  lcd.write(LR);
404
     lcd.setCursor(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------"));  lcd.write(BRC);
401
     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);
407
     picBits = ICON_LOGO;
404
     picBits = ICON_LOGO;
408
     lcd.print_screen();
405
     lcd.print_screen();
409
   }
406
   }
420
   lcd.setCursor(0, 3);  lcd.write(COLOR_ERROR);
417
   lcd.setCursor(0, 3);  lcd.write(COLOR_ERROR);
421
   lcd.setCursor((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3);
418
   lcd.setCursor((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3);
422
   lcd_put_u8str(status_message);
419
   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);
425
   lcd.print_screen();
422
   lcd.print_screen();
426
 }
423
 }
427
 
424
 
940
   #endif
937
   #endif
941
 
938
 
942
   // Draw a static item with no left-right margin required. Centered by default.
939
   // 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*/) {
944
     if (!PanelDetected) return;
941
     if (!PanelDetected) return;
945
     uint8_t n = LCD_WIDTH;
942
     uint8_t n = LCD_WIDTH;
946
     lcd.setCursor(0, row);
943
     lcd.setCursor(0, row);
947
     if ((style & SS_CENTER) && !valstr) {
944
     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;
949
       while (--pad >= 0) { lcd.write(' '); n--; }
946
       while (--pad >= 0) { lcd.write(' '); n--; }
950
     }
947
     }
951
-    n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n);
948
+    n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n);
952
     if (valstr) n -= lcd_put_u8str_max(valstr, n);
949
     if (valstr) n -= lcd_put_u8str_max(valstr, n);
953
     for (; n; --n) lcd.write(' ');
950
     for (; n; --n) lcd.write(' ');
954
     lcd.print_line();
951
     lcd.print_line();
955
   }
952
   }
956
 
953
 
957
   // Draw a generic menu item with pre_char (if selected) and post_char
954
   // 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) {
959
     if (!PanelDetected) return;
956
     if (!PanelDetected) return;
960
     lcd.setCursor(0, row);
957
     lcd.setCursor(0, row);
961
     lcd.write(sel ? pre_char : ' ');
958
     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);
963
     for (; n; --n) lcd.write(' ');
960
     for (; n; --n) lcd.write(' ');
964
     lcd.write(post_char);
961
     lcd.write(post_char);
965
     lcd.print_line();
962
     lcd.print_line();
966
   }
963
   }
967
 
964
 
968
   // Draw a menu item with a (potentially) editable value
965
   // 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) {
970
     if (!PanelDetected) return;
967
     if (!PanelDetected) return;
971
     const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0;
968
     const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0;
972
     lcd.setCursor(0, row);
969
     lcd.setCursor(0, row);
973
     lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
970
     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);
975
     if (vlen) {
972
     if (vlen) {
976
       lcd.write(':');
973
       lcd.write(':');
977
       for (; n; --n) lcd.write(' ');
974
       for (; n; --n) lcd.write(' ');
982
 
979
 
983
   // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
980
   // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
984
   // This line moves to the last line of the screen for UBL plot screen on the panel side
981
   // 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*/) {
986
     if (!PanelDetected) return;
983
     if (!PanelDetected) return;
987
     ui.encoder_direction_normal();
984
     ui.encoder_direction_normal();
988
     const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y;
985
     const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y;
989
     lcd.setCursor(0, y);
986
     lcd.setCursor(0, y);
990
     lcd.write(COLOR_EDIT);
987
     lcd.write(COLOR_EDIT);
991
-    lcd_put_u8str_P(pstr);
988
+    lcd_put_u8str(fstr);
992
     if (value) {
989
     if (value) {
993
       lcd.write(':');
990
       lcd.write(':');
994
       lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces
991
       lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces
1000
   }
997
   }
1001
 
998
 
1002
   // The Select Screen presents a prompt and two "buttons"
999
   // 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) {
1004
     if (!PanelDetected) return;
1001
     if (!PanelDetected) return;
1005
     ui.draw_select_screen_prompt(pref, string, suff);
1002
     ui.draw_select_screen_prompt(pref, string, suff);
1006
     lcd.write(COLOR_EDIT);
1003
     lcd.write(COLOR_EDIT);
1007
     if (no) {
1004
     if (no) {
1008
       lcd.setCursor(0, MIDDLE_Y);
1005
       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 ? ' ' : ']');
1010
     }
1007
     }
1011
     if (yes) {
1008
     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 ? ']' : ' ');
1014
     }
1011
     }
1015
     lcd.print_line();
1012
     lcd.print_line();
1016
   }
1013
   }
1017
 
1014
 
1018
   #if ENABLED(SDSUPPORT)
1015
   #if ENABLED(SDSUPPORT)
1019
 
1016
 
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) {
1021
       if (!PanelDetected) return;
1018
       if (!PanelDetected) return;
1022
       lcd.setCursor(0, row);
1019
       lcd.setCursor(0, row);
1023
       lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
1020
       lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
1081
       else
1078
       else
1082
         lcd_put_u8str(F(" -----"));
1079
         lcd_put_u8str(F(" -----"));
1083
 
1080
 
1084
-      center_text_P(GET_TEXT(MSG_UBL_FINE_TUNE_MESH), 8);
1081
+      center_text(GET_TEXT_F(MSG_UBL_FINE_TUNE_MESH), 8);
1085
 
1082
 
1086
       lcd.print_screen();
1083
       lcd.print_screen();
1087
     }
1084
     }

+ 16
- 16
Marlin/src/lcd/dogm/marlinui_DOGM.cpp Visa fil

412
   }
412
   }
413
 
413
 
414
   // Draw a static line of text in the same idiom as a menu item
414
   // 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*/) {
416
 
416
 
417
     if (mark_as_selected(row, style & SS_INVERT)) {
417
     if (mark_as_selected(row, style & SS_INVERT)) {
418
       pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
418
       pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
419
 
419
 
420
-      const int plen = pstr ? calculateWidth(pstr) : 0,
420
+      const int plen = fstr ? calculateWidth(FTOP(fstr)) : 0,
421
                 vlen = vstr ? utf8_strlen(vstr) : 0;
421
                 vlen = vstr ? utf8_strlen(vstr) : 0;
422
       if (style & SS_CENTER) {
422
       if (style & SS_CENTER) {
423
         int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2;
423
         int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2;
424
         while (--pad >= 0) n -= lcd_put_wchar(' ');
424
         while (--pad >= 0) n -= lcd_put_wchar(' ');
425
       }
425
       }
426
 
426
 
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);
428
       if (vlen) n -= lcd_put_u8str_max(vstr, n);
428
       if (vlen) n -= lcd_put_u8str_max(vstr, n);
429
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
429
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
430
     }
430
     }
431
   }
431
   }
432
 
432
 
433
   // Draw a generic menu item
433
   // 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) {
435
     if (mark_as_selected(row, sel)) {
435
     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);
437
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
437
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
438
       lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
438
       lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
439
       lcd_put_wchar(' ');
439
       lcd_put_wchar(' ');
441
   }
441
   }
442
 
442
 
443
   // Draw a menu item with an editable value
443
   // 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) {
445
     if (mark_as_selected(row, sel)) {
445
     if (mark_as_selected(row, sel)) {
446
       const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)),
446
       const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)),
447
                     pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr));
447
                     pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr));
448
       const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
448
       const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
449
 
449
 
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);
451
       if (vallen) {
451
       if (vallen) {
452
         lcd_put_wchar(':');
452
         lcd_put_wchar(':');
453
         while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
453
         while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
457
     }
457
     }
458
   }
458
   }
459
 
459
 
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*/) {
461
     ui.encoder_direction_normal();
461
     ui.encoder_direction_normal();
462
 
462
 
463
     const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
463
     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);
465
     bool extra_row = labellen * prop > LCD_WIDTH - 2 - vallen * prop;
465
     bool extra_row = labellen * prop > LCD_WIDTH - 2 - vallen * prop;
466
 
466
 
467
     #if ENABLED(USE_BIG_EDIT_FONT)
467
     #if ENABLED(USE_BIG_EDIT_FONT)
490
 
490
 
491
     // Assume the label is alpha-numeric (with a descender)
491
     // Assume the label is alpha-numeric (with a descender)
492
     bool onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline + EDIT_FONT_DESCENT);
492
     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);
494
 
494
 
495
     // If a value is included, print a colon, then print the value right-justified
495
     // If a value is included, print a colon, then print the value right-justified
496
     if (value) {
496
     if (value) {
508
     TERN_(USE_BIG_EDIT_FONT, ui.set_font(FONT_MENU));
508
     TERN_(USE_BIG_EDIT_FONT, ui.set_font(FONT_MENU));
509
   }
509
   }
510
 
510
 
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),
513
                       by = (y + 1) * (MENU_FONT_HEIGHT);
513
                       by = (y + 1) * (MENU_FONT_HEIGHT);
514
     const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
514
     const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1;
515
     const pixel_len_t bw = len * prop * (MENU_FONT_WIDTH), bx = x * prop * (MENU_FONT_WIDTH);
515
     const pixel_len_t bw = len * prop * (MENU_FONT_WIDTH), bx = x * prop * (MENU_FONT_WIDTH);
518
       u8g.drawBox(bx / prop - 1, by - (MENU_FONT_ASCENT), bw + 2, MENU_FONT_HEIGHT);
518
       u8g.drawBox(bx / prop - 1, by - (MENU_FONT_ASCENT), bw + 2, MENU_FONT_HEIGHT);
519
       u8g.setColorIndex(0);
519
       u8g.setColorIndex(0);
520
     }
520
     }
521
-    lcd_put_u8str_P(bx / prop, by, pstr);
521
+    lcd_put_u8str(bx / prop, by, fstr);
522
     if (inv) u8g.setColorIndex(1);
522
     if (inv) u8g.setColorIndex(1);
523
   }
523
   }
524
 
524
 
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*/) {
526
     ui.draw_select_screen_prompt(pref, string, suff);
526
     ui.draw_select_screen_prompt(pref, string, suff);
527
     if (no)  draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno);
527
     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);
529
   }
529
   }
530
 
530
 
531
   #if ENABLED(SDSUPPORT)
531
   #if ENABLED(SDSUPPORT)
532
 
532
 
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) {
534
       if (mark_as_selected(row, sel)) {
534
       if (mark_as_selected(row, sel)) {
535
         const uint8_t maxlen = LCD_WIDTH - isDir;
535
         const uint8_t maxlen = LCD_WIDTH - isDir;
536
         if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);
536
         if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);

+ 6
- 6
Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp Visa fil

517
       drawCross(x, y, TFT_MARLINBG_COLOR);
517
       drawCross(x, y, TFT_MARLINBG_COLOR);
518
     }
518
     }
519
 
519
 
520
-    const char *str = nullptr;
520
+    FSTR_P str = nullptr;
521
     if (calibration_stage < CALIBRATION_SUCCESS) {
521
     if (calibration_stage < CALIBRATION_SUCCESS) {
522
       // handle current state
522
       // handle current state
523
       switch (calibration_stage) {
523
       switch (calibration_stage) {
524
-        case CALIBRATION_TOP_LEFT: str = GET_TEXT(MSG_TOP_LEFT); break;
525
-        case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT(MSG_BOTTOM_LEFT); break;
526
-        case CALIBRATION_TOP_RIGHT:  str = GET_TEXT(MSG_TOP_RIGHT); break;
527
-        case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT(MSG_BOTTOM_RIGHT); break;
524
+        case CALIBRATION_TOP_LEFT: str = GET_TEXT_F(MSG_TOP_LEFT); break;
525
+        case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT_F(MSG_BOTTOM_LEFT); break;
526
+        case CALIBRATION_TOP_RIGHT:  str = GET_TEXT_F(MSG_TOP_RIGHT); break;
527
+        case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT_F(MSG_BOTTOM_RIGHT); break;
528
         default: break;
528
         default: break;
529
       }
529
       }
530
 
530
 
534
     }
534
     }
535
     else {
535
     else {
536
       // end calibration
536
       // end calibration
537
-      str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED);
537
+      str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT_F(MSG_CALIBRATION_COMPLETED) : GET_TEXT_F(MSG_CALIBRATION_FAILED);
538
       defer_status_screen(false);
538
       defer_status_screen(false);
539
       touch_calibration.calibration_end();
539
       touch_calibration.calibration_end();
540
       TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
540
       TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);

+ 1
- 1
Marlin/src/lcd/e3v2/common/dwin_api.h Visa fil

74
 
74
 
75
 inline void DWIN_Text(size_t &i, FSTR_P string, uint16_t rlimit=0xFFFF) {
75
 inline void DWIN_Text(size_t &i, FSTR_P string, uint16_t rlimit=0xFFFF) {
76
   if (!string) return;
76
   if (!string) return;
77
-  const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, _MIN(rlimit, strlen_P((PGM_P)string))); // cast to PGM_P (const char*) measure with strlen_P.
77
+  const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, _MIN(rlimit, strlen_P(FTOP(string))));
78
   if (len == 0) return;
78
   if (len == 0) return;
79
   memcpy_P(&DWIN_SendBuf[i+1], string, len);
79
   memcpy_P(&DWIN_SendBuf[i+1], string, len);
80
   i += len;
80
   i += len;

+ 2
- 2
Marlin/src/lcd/e3v2/jyersui/dwin.cpp Visa fil

2944
             break;
2944
             break;
2945
           case LEVELING_VIEW:
2945
           case LEVELING_VIEW:
2946
             if (draw)
2946
             if (draw)
2947
-              Draw_Menu_Item(row, ICON_Mesh, GET_TEXT(MSG_MESH_VIEW), nullptr, true);
2947
+              Draw_Menu_Item(row, ICON_Mesh, GET_TEXT_F(MSG_MESH_VIEW), nullptr, true);
2948
             else {
2948
             else {
2949
               #if ENABLED(AUTO_BED_LEVELING_UBL)
2949
               #if ENABLED(AUTO_BED_LEVELING_UBL)
2950
                 if (bedlevel.storage_slot < 0) {
2950
                 if (bedlevel.storage_slot < 0) {
3017
             break;
3017
             break;
3018
           case LEVELING_VIEW_MESH:
3018
           case LEVELING_VIEW_MESH:
3019
             if (draw)
3019
             if (draw)
3020
-              Draw_Menu_Item(row, ICON_PrintSize, GET_TEXT(MSG_MESH_VIEW), nullptr, true);
3020
+              Draw_Menu_Item(row, ICON_PrintSize, GET_TEXT_F(MSG_MESH_VIEW), nullptr, true);
3021
             else
3021
             else
3022
               Draw_Menu(MeshViewer);
3022
               Draw_Menu(MeshViewer);
3023
             break;
3023
             break;

+ 4
- 4
Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp Visa fil

43
 /**
43
 /**
44
  * Add a string, applying substitutions for the following characters:
44
  * Add a string, applying substitutions for the following characters:
45
  *
45
  *
46
- *   $ displays the clipped C-string given by the itemString argument
46
+ *   $ displays the clipped C-string given by the inStr argument
47
  *   = displays  '0'....'10' for indexes 0 - 10
47
  *   = displays  '0'....'10' for indexes 0 - 10
48
  *   ~ displays  '1'....'11' for indexes 0 - 10
48
  *   ~ displays  '1'....'11' for indexes 0 - 10
49
  *   * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
49
  *   * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
50
  *   @ displays an axis name such as XYZUVW, or E for an extruder
50
  *   @ displays an axis name such as XYZUVW, or E for an extruder
51
  */
51
  */
52
-void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*=nullptr*/) {
52
+void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *inStr/*=nullptr*/) {
53
   wchar_t wchar;
53
   wchar_t wchar;
54
 
54
 
55
   while (*string) {
55
   while (*string) {
67
       else
67
       else
68
         add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED));
68
         add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED));
69
     }
69
     }
70
-    else if (ch == '$' && itemString)
71
-      add(itemString);
70
+    else if (ch == '$' && inStr)
71
+      add(inStr);
72
     else if (ch == '@')
72
     else if (ch == '@')
73
       add_character(AXIS_CHAR(index));
73
       add_character(AXIS_CHAR(index));
74
     else
74
     else

+ 9
- 4
Marlin/src/lcd/e3v2/marlinui/dwin_string.h Visa fil

61
     //static void add(uint8_t character) { add_character(character); eol(); }
61
     //static void add(uint8_t character) { add_character(character); eol(); }
62
     static void add(wchar_t character);
62
     static void add(wchar_t character);
63
     static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH);
63
     static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH);
64
-    static void add(uint8_t *string, const int8_t index, uint8_t *itemString=nullptr);
64
+    static void add(uint8_t *string, const int8_t index, uint8_t *inStr=nullptr);
65
     static void set(uint8_t *string)   { set(); add(string); }
65
     static void set(uint8_t *string)   { set(); add(string); }
66
     static void set(wchar_t character) { set(); add(character); }
66
     static void set(wchar_t character) { set(); add(character); }
67
-    static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); }
68
-    static void set(FSTR_P fstring) { set((uint8_t *)fstring); }
67
+    static void set(uint8_t *string, int8_t index, const char *inStr=nullptr) { set(); add(string, index, (uint8_t *)inStr); }
69
     static void set(const char *string) { set((uint8_t *)string); }
68
     static void set(const char *string) { set((uint8_t *)string); }
70
-    static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
69
+    static void set(const char *string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)string, index, inStr); }
71
     static void add(const char *string) { add((uint8_t *)string); }
70
     static void add(const char *string) { add((uint8_t *)string); }
72
 
71
 
72
+    static void add(FSTR_P const string, uint8_t max_len=MAX_STRING_LENGTH) { add((uint8_t *)FTOP(string), max_len); }
73
+    static void add(FSTR_P const string, int8_t index, uint8_t *inStr=nullptr) { add((uint8_t *)FTOP(string), index, inStr); }
74
+    static void set(FSTR_P const string) { set((uint8_t *)FTOP(string)); }
75
+    static void set(FSTR_P const string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)FTOP(string), index, inStr); }
76
+    static void add(FSTR_P const string) { add((uint8_t *)FTOP(string)); }
77
+
73
     static void trim(const uint8_t character=0x20);
78
     static void trim(const uint8_t character=0x20);
74
     static void rtrim(const uint8_t character=0x20);
79
     static void rtrim(const uint8_t character=0x20);
75
     static void ltrim(const uint8_t character=0x20);
80
     static void ltrim(const uint8_t character=0x20);

+ 18
- 18
Marlin/src/lcd/e3v2/marlinui/ui_common.cpp Visa fil

311
 
311
 
312
   // Draw a static line of text in the same idiom as a menu item
312
   // Draw a static line of text in the same idiom as a menu item
313
 
313
 
314
-  void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
314
+  void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
315
     // Call mark_as_selected to draw a bigger selection box
315
     // Call mark_as_selected to draw a bigger selection box
316
     // and draw the text without a background
316
     // and draw the text without a background
317
     if (mark_as_selected(row, (bool)(style & SS_INVERT), true)) {
317
     if (mark_as_selected(row, (bool)(style & SS_INVERT), true)) {
320
       dwin_font.fg = Color_White;
320
       dwin_font.fg = Color_White;
321
 
321
 
322
       dwin_string.set();
322
       dwin_string.set();
323
-      const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0,
323
+      const int8_t plen = fstr ? utf8_strlen(fstr) : 0,
324
                    vlen = vstr ? utf8_strlen(vstr) : 0;
324
                    vlen = vstr ? utf8_strlen(vstr) : 0;
325
       if (style & SS_CENTER) {
325
       if (style & SS_CENTER) {
326
         int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2;
326
         int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2;
327
         while (--pad) dwin_string.add(' ');
327
         while (--pad) dwin_string.add(' ');
328
       }
328
       }
329
 
329
 
330
-      if (plen) dwin_string.add((uint8_t*)pstr, itemIndex, (uint8_t*)itemString);
330
+      if (plen) dwin_string.add((uint8_t*)FTOP(fstr), itemIndex, (uint8_t*)FTOP(itemString));
331
       if (vlen) dwin_string.add((uint8_t*)vstr);
331
       if (vlen) dwin_string.add((uint8_t*)vstr);
332
       if (style & SS_CENTER) {
332
       if (style & SS_CENTER) {
333
         int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2;
333
         int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2;
340
   }
340
   }
341
 
341
 
342
   // Draw a generic menu item
342
   // Draw a generic menu item
343
-  void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) {
343
+  void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char, const char post_char) {
344
     if (mark_as_selected(row, sel)) {
344
     if (mark_as_selected(row, sel)) {
345
       ui.set_font(DWIN_FONT_MENU);
345
       ui.set_font(DWIN_FONT_MENU);
346
       dwin_font.solid = false;
346
       dwin_font.solid = false;
347
       dwin_font.fg = Color_White;
347
       dwin_font.fg = Color_White;
348
 
348
 
349
-      dwin_string.set(pstr, itemIndex, itemString);
349
+      dwin_string.set(fstr, itemIndex, FTOP(itemString));
350
 
350
 
351
       pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length();
351
       pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length();
352
       while (--n > 1) dwin_string.add(' ');
352
       while (--n > 1) dwin_string.add(' ');
361
   //
361
   //
362
   // Draw a menu item with an editable value
362
   // Draw a menu item with an editable value
363
   //
363
   //
364
-  void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) {
364
+  void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) {
365
     if (mark_as_selected(row, sel)) {
365
     if (mark_as_selected(row, sel)) {
366
       ui.set_font(DWIN_FONT_MENU);
366
       ui.set_font(DWIN_FONT_MENU);
367
       dwin_font.solid = false;
367
       dwin_font.solid = false;
368
       dwin_font.fg = Color_White;
368
       dwin_font.fg = Color_White;
369
 
369
 
370
-      const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen(S(data)));
370
+      const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(S(inStr)));
371
 
371
 
372
-      dwin_string.set(pstr, itemIndex, itemString);
372
+      dwin_string.set(fstr, itemIndex, FTOP(itemString));
373
       if (vallen) dwin_string.add(':');
373
       if (vallen) dwin_string.add(':');
374
 
374
 
375
       lcd_moveto(1, row);
375
       lcd_moveto(1, row);
377
 
377
 
378
       if (vallen) {
378
       if (vallen) {
379
         dwin_font.fg = Color_Yellow;
379
         dwin_font.fg = Color_Yellow;
380
-        dwin_string.set(data);
380
+        dwin_string.set(inStr);
381
         lcd_moveto(LCD_WIDTH - vallen - 1, row);
381
         lcd_moveto(LCD_WIDTH - vallen - 1, row);
382
         lcd_put_dwin_string();
382
         lcd_put_dwin_string();
383
       }
383
       }
387
   //
387
   //
388
   // Draw an edit screen with label and current value
388
   // Draw an edit screen with label and current value
389
   //
389
   //
390
-  void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) {
390
+  void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char* const value/*=nullptr*/) {
391
     ui.encoder_direction_normal();
391
     ui.encoder_direction_normal();
392
 
392
 
393
-    const dwin_coord_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value);
393
+    const dwin_coord_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value);
394
 
394
 
395
     dwin_string.set();
395
     dwin_string.set();
396
-    dwin_string.add((uint8_t*)pstr, itemIndex);
396
+    dwin_string.add((uint8_t*)FTOP(fstr), itemIndex);
397
     if (vallen) dwin_string.add(':');  // If a value is included, add a colon
397
     if (vallen) dwin_string.add(':');  // If a value is included, add a colon
398
 
398
 
399
     // Assume the label is alpha-numeric (with a descender)
399
     // Assume the label is alpha-numeric (with a descender)
430
     }
430
     }
431
   }
431
   }
432
 
432
 
433
-  inline void draw_boxed_string(const bool yesopt, PGM_P const pstr, const bool inv) {
434
-    const uint8_t len = utf8_strlen_P(pstr),
433
+  inline void draw_boxed_string(const bool yesopt, FSTR_P const fstr, const bool inv) {
434
+    const uint8_t len = utf8_strlen(fstr),
435
                   mar = TERN(DWIN_MARLINUI_PORTRAIT, 1, 4),
435
                   mar = TERN(DWIN_MARLINUI_PORTRAIT, 1, 4),
436
                   col = yesopt ? LCD_WIDTH - mar - len : mar,
436
                   col = yesopt ? LCD_WIDTH - mar - len : mar,
437
                   row = (LCD_HEIGHT >= 8 ? LCD_HEIGHT / 2 + 3 : LCD_HEIGHT - 1);
437
                   row = (LCD_HEIGHT >= 8 ? LCD_HEIGHT / 2 + 3 : LCD_HEIGHT - 1);
438
     lcd_moveto(col, row);
438
     lcd_moveto(col, row);
439
     DWIN_Draw_Box(1, inv ? Select_Color : Color_Bg_Black, cursor.x - dwin_font.width, cursor.y + 1, dwin_font.width * (len + 2), dwin_font.height + 2);
439
     DWIN_Draw_Box(1, inv ? Select_Color : Color_Bg_Black, cursor.x - dwin_font.width, cursor.y + 1, dwin_font.width * (len + 2), dwin_font.height + 2);
440
-    lcd_put_u8str_P(col, row, pstr);
440
+    lcd_put_u8str(col, row, fstr);
441
   }
441
   }
442
 
442
 
443
   void MenuItem_confirm::draw_select_screen(
443
   void MenuItem_confirm::draw_select_screen(
444
-    PGM_P const yes, PGM_P const no, const bool yesno,
445
-    PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/
444
+    FSTR_P const yes, FSTR_P const no, const bool yesno,
445
+    FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/
446
   ) {
446
   ) {
447
     ui.set_font(DWIN_FONT_MENU);
447
     ui.set_font(DWIN_FONT_MENU);
448
     dwin_font.solid = false;
448
     dwin_font.solid = false;
454
 
454
 
455
   #if ENABLED(SDSUPPORT)
455
   #if ENABLED(SDSUPPORT)
456
 
456
 
457
-    void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) {
457
+    void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
458
       if (mark_as_selected(row, sel)) {
458
       if (mark_as_selected(row, sel)) {
459
         dwin_string.set();
459
         dwin_string.set();
460
 
460
 

+ 1
- 1
Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp Visa fil

64
       .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE))
64
       .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE))
65
       .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
65
       .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
66
                .colors(action_btn)
66
                .colors(action_btn)
67
-      .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE));
67
+      .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE));
68
   }
68
   }
69
 }
69
 }
70
 
70
 

+ 24
- 24
Marlin/src/lcd/marlinui.cpp Visa fil

140
 
140
 
141
   preheat_t MarlinUI::material_preset[PREHEAT_COUNT];  // Initialized by settings.load()
141
   preheat_t MarlinUI::material_preset[PREHEAT_COUNT];  // Initialized by settings.load()
142
 
142
 
143
-  PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
143
+  FSTR_P MarlinUI::get_preheat_label(const uint8_t m) {
144
     #define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL);
144
     #define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL);
145
     #define _PLBL(N) preheat_##N##_label,
145
     #define _PLBL(N) preheat_##N##_label,
146
     REPEAT_1(PREHEAT_COUNT, _PDEF);
146
     REPEAT_1(PREHEAT_COUNT, _PDEF);
147
     static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_1(PREHEAT_COUNT, _PLBL) };
147
     static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_1(PREHEAT_COUNT, _PLBL) };
148
-    return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
148
+    return FPSTR((PGM_P)pgm_read_ptr(&preheat_labels[m]));
149
   }
149
   }
150
 
150
 
151
   void MarlinUI::apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e/*=active_extruder*/) {
151
   void MarlinUI::apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e/*=active_extruder*/) {
454
         }
454
         }
455
       }
455
       }
456
 
456
 
457
-      void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
458
-        const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0;
457
+      void MarlinUI::draw_select_screen_prompt(FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) {
458
+        const uint8_t plen = utf8_strlen(pref), slen = suff ? utf8_strlen(suff) : 0;
459
         uint8_t col = 0, row = 0;
459
         uint8_t col = 0, row = 0;
460
         if (!string && plen + slen <= LCD_WIDTH) {
460
         if (!string && plen + slen <= LCD_WIDTH) {
461
           col = (LCD_WIDTH - plen - slen) / 2;
461
           col = (LCD_WIDTH - plen - slen) / 2;
462
           row = LCD_HEIGHT > 3 ? 1 : 0;
462
           row = LCD_HEIGHT > 3 ? 1 : 0;
463
         }
463
         }
464
         if (LCD_HEIGHT >= 8) row = LCD_HEIGHT / 2 - 2;
464
         if (LCD_HEIGHT >= 8) row = LCD_HEIGHT / 2 - 2;
465
-        wrap_string_P(col, row, pref, true);
465
+        wrap_string_P(col, row, FTOP(pref), true);
466
         if (string) {
466
         if (string) {
467
           if (col) { col = 0; row++; } // Move to the start of the next line
467
           if (col) { col = 0; row++; } // Move to the start of the next line
468
           wrap_string(col, row, string);
468
           wrap_string(col, row, string);
469
         }
469
         }
470
-        if (suff) wrap_string_P(col, row, suff);
470
+        if (suff) wrap_string_P(col, row, FTOP(suff));
471
       }
471
       }
472
 
472
 
473
     #endif // !HAS_GRAPHICAL_TFT
473
     #endif // !HAS_GRAPHICAL_TFT
484
 
484
 
485
     #if HAS_MARLINUI_MENU && !HAS_ADC_BUTTONS
485
     #if HAS_MARLINUI_MENU && !HAS_ADC_BUTTONS
486
 
486
 
487
-      void lcd_move_x();
488
-      void lcd_move_y();
489
-      void lcd_move_z();
490
-
491
       void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) {
487
       void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) {
492
         ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
488
         ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
493
         ui.encoderPosition = dir;
489
         ui.encoderPosition = dir;
494
         switch (axis) {
490
         switch (axis) {
495
-          case X_AXIS: lcd_move_x(); break;
496
-          case Y_AXIS: lcd_move_y(); break;
497
-          case Z_AXIS: lcd_move_z();
491
+          case X_AXIS: { void lcd_move_x(); lcd_move_x(); } break;
492
+          #if HAS_Y_AXIS
493
+            case Y_AXIS: { void lcd_move_y(); lcd_move_y(); } break;
494
+          #endif
495
+          #if HAS_Z_AXIS
496
+            case Z_AXIS: { void lcd_move_z(); lcd_move_z(); } break;
497
+          #endif
498
           default: break;
498
           default: break;
499
         }
499
         }
500
       }
500
       }
1651
 
1651
 
1652
   void MarlinUI::pause_print() {
1652
   void MarlinUI::pause_print() {
1653
     #if HAS_MARLINUI_MENU
1653
     #if HAS_MARLINUI_MENU
1654
-      synchronize(GET_TEXT(MSG_PAUSING));
1654
+      synchronize(GET_TEXT_F(MSG_PAUSING));
1655
       defer_status_screen();
1655
       defer_status_screen();
1656
     #endif
1656
     #endif
1657
 
1657
 
1855
 
1855
 
1856
   #if DISABLED(EEPROM_AUTO_INIT)
1856
   #if DISABLED(EEPROM_AUTO_INIT)
1857
 
1857
 
1858
-    static inline PGM_P eeprom_err(const uint8_t msgid) {
1858
+    static inline FSTR_P eeprom_err(const uint8_t msgid) {
1859
       switch (msgid) {
1859
       switch (msgid) {
1860
         default:
1860
         default:
1861
-        case 0: return GET_TEXT(MSG_ERR_EEPROM_CRC);
1862
-        case 1: return GET_TEXT(MSG_ERR_EEPROM_INDEX);
1863
-        case 2: return GET_TEXT(MSG_ERR_EEPROM_VERSION);
1861
+        case 0: return GET_TEXT_F(MSG_ERR_EEPROM_CRC);
1862
+        case 1: return GET_TEXT_F(MSG_ERR_EEPROM_INDEX);
1863
+        case 2: return GET_TEXT_F(MSG_ERR_EEPROM_VERSION);
1864
       }
1864
       }
1865
     }
1865
     }
1866
 
1866
 
1868
       #if HAS_MARLINUI_MENU
1868
       #if HAS_MARLINUI_MENU
1869
         editable.uint8 = msgid;
1869
         editable.uint8 = msgid;
1870
         goto_screen([]{
1870
         goto_screen([]{
1871
-          PGM_P const restore_msg = GET_TEXT(MSG_INIT_EEPROM);
1872
-          char msg[utf8_strlen_P(restore_msg) + 1];
1873
-          strcpy_P(msg, restore_msg);
1871
+          FSTR_P const restore_msg = GET_TEXT_F(MSG_INIT_EEPROM);
1872
+          char msg[utf8_strlen(restore_msg) + 1];
1873
+          strcpy_P(msg, FTOP(restore_msg));
1874
           MenuItem_confirm::select_screen(
1874
           MenuItem_confirm::select_screen(
1875
-            GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_IGNORE),
1875
+            GET_TEXT_F(MSG_BUTTON_RESET), GET_TEXT_F(MSG_BUTTON_IGNORE),
1876
             init_eeprom, return_to_status,
1876
             init_eeprom, return_to_status,
1877
-            eeprom_err(editable.uint8), msg, PSTR("?")
1877
+            eeprom_err(editable.uint8), msg, F("?")
1878
           );
1878
           );
1879
         });
1879
         });
1880
       #else
1880
       #else
1881
-        set_status(FPSTR(eeprom_err(msgid)));
1881
+        set_status(eeprom_err(msgid));
1882
       #endif
1882
       #endif
1883
     }
1883
     }
1884
 
1884
 

+ 3
- 3
Marlin/src/lcd/marlinui.h Visa fil

520
   #if HAS_PREHEAT
520
   #if HAS_PREHEAT
521
     enum PreheatTarget : uint8_t { PT_HOTEND, PT_BED, PT_FAN, PT_CHAMBER, PT_ALL = 0xFF };
521
     enum PreheatTarget : uint8_t { PT_HOTEND, PT_BED, PT_FAN, PT_CHAMBER, PT_ALL = 0xFF };
522
     static preheat_t material_preset[PREHEAT_COUNT];
522
     static preheat_t material_preset[PREHEAT_COUNT];
523
-    static PGM_P get_preheat_label(const uint8_t m);
523
+    static FSTR_P get_preheat_label(const uint8_t m);
524
     static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder);
524
     static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder);
525
     static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, _BV(PT_FAN))); }
525
     static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, _BV(PT_FAN))); }
526
     static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND))); }
526
     static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND))); }
559
     static void set_selection(const bool sel) { selection = sel; }
559
     static void set_selection(const bool sel) { selection = sel; }
560
     static bool update_selection();
560
     static bool update_selection();
561
 
561
 
562
-    static void synchronize(PGM_P const msg=nullptr);
562
+    static void synchronize(FSTR_P const msg=nullptr);
563
 
563
 
564
     static screenFunc_t currentScreen;
564
     static screenFunc_t currentScreen;
565
     static bool screen_changed;
565
     static bool screen_changed;
605
       static float ubl_mesh_value();
605
       static float ubl_mesh_value();
606
     #endif
606
     #endif
607
 
607
 
608
-    static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr);
608
+    static void draw_select_screen_prompt(FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr);
609
 
609
 
610
   #else
610
   #else
611
 
611
 

+ 10
- 10
Marlin/src/lcd/menu/menu.cpp Visa fil

69
 uint8_t screen_history_depth = 0;
69
 uint8_t screen_history_depth = 0;
70
 
70
 
71
 int8_t MenuItemBase::itemIndex;   // Index number for draw and action
71
 int8_t MenuItemBase::itemIndex;   // Index number for draw and action
72
-PGM_P MenuItemBase::itemString;   // A PSTR for substitution
72
+FSTR_P MenuItemBase::itemString;  // A string for substitution
73
 chimera_t editable;               // Value Editing
73
 chimera_t editable;               // Value Editing
74
 
74
 
75
 // Menu Edit Items
75
 // Menu Edit Items
76
-PGM_P        MenuEditItemBase::editLabel;
76
+FSTR_P       MenuEditItemBase::editLabel;
77
 void*        MenuEditItemBase::editValue;
77
 void*        MenuEditItemBase::editValue;
78
 int32_t      MenuEditItemBase::minEditValue,
78
 int32_t      MenuEditItemBase::minEditValue,
79
              MenuEditItemBase::maxEditValue;
79
              MenuEditItemBase::maxEditValue;
134
 
134
 
135
 // Going to an edit screen sets up some persistent values first
135
 // Going to an edit screen sets up some persistent values first
136
 void MenuEditItemBase::goto_edit_screen(
136
 void MenuEditItemBase::goto_edit_screen(
137
-  PGM_P const el,         // Edit label
137
+  FSTR_P const el,        // Edit label
138
   void * const ev,        // Edit value pointer
138
   void * const ev,        // Edit value pointer
139
   const int32_t minv,     // Encoder minimum
139
   const int32_t minv,     // Encoder minimum
140
   const int32_t maxv,     // Encoder maximum
140
   const int32_t maxv,     // Encoder maximum
232
 // Display a "synchronize" screen with a custom message until
232
 // Display a "synchronize" screen with a custom message until
233
 // all moves are finished. Go back to calling screen when done.
233
 // all moves are finished. Go back to calling screen when done.
234
 //
234
 //
235
-void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) {
236
-  static PGM_P sync_message = msg ?: GET_TEXT(MSG_MOVING);
235
+void MarlinUI::synchronize(FSTR_P const fmsg/*=nullptr*/) {
236
+  static FSTR_P sync_message = fmsg ?: GET_TEXT_F(MSG_MOVING);
237
   push_current_screen();
237
   push_current_screen();
238
   goto_screen([]{
238
   goto_screen([]{
239
     if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message);
239
     if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message);
319
     }
319
     }
320
     if (ui.should_draw()) {
320
     if (ui.should_draw()) {
321
       if (do_probe) {
321
       if (do_probe) {
322
-        MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z));
322
+        MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z));
323
         TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z));
323
         TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z));
324
       }
324
       }
325
       else {
325
       else {
326
         #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
326
         #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
327
-          MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z));
327
+          MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z));
328
         #endif
328
         #endif
329
       }
329
       }
330
     }
330
     }
335
 void _lcd_draw_homing() {
335
 void _lcd_draw_homing() {
336
   if (ui.should_draw()) {
336
   if (ui.should_draw()) {
337
     constexpr uint8_t line = (LCD_HEIGHT - 1) / 2;
337
     constexpr uint8_t line = (LCD_HEIGHT - 1) / 2;
338
-    MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING));
338
+    MenuItem_static::draw(line, GET_TEXT_F(MSG_LEVEL_BED_HOMING));
339
   }
339
   }
340
 }
340
 }
341
 
341
 
357
 }
357
 }
358
 
358
 
359
 void MenuItem_confirm::select_screen(
359
 void MenuItem_confirm::select_screen(
360
-  PGM_P const yes, PGM_P const no,
360
+  FSTR_P const yes, FSTR_P const no,
361
   selectFunc_t yesFunc, selectFunc_t noFunc,
361
   selectFunc_t yesFunc, selectFunc_t noFunc,
362
-  PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/
362
+  FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/
363
 ) {
363
 ) {
364
   ui.defer_status_screen();
364
   ui.defer_status_screen();
365
   const bool ui_selection = !yes ? false : !no || ui.update_selection(),
365
   const bool ui_selection = !yes ? false : !no || ui.update_selection(),

+ 30
- 26
Marlin/src/lcd/menu/menu.h Visa fil

54
     static int8_t itemIndex;
54
     static int8_t itemIndex;
55
 
55
 
56
     // An optional pointer for use in display or by the action
56
     // An optional pointer for use in display or by the action
57
-    static PGM_P itemString;
57
+    static FSTR_P itemString;
58
 
58
 
59
     // Store the index of the item ahead of use by indexed items
59
     // Store the index of the item ahead of use by indexed items
60
-    FORCE_INLINE static void init(const int8_t ind=0, PGM_P const pstr=nullptr) { itemIndex = ind; itemString = pstr; }
60
+    FORCE_INLINE static void init(const int8_t ind=0, FSTR_P const fstr=nullptr) { itemIndex = ind; itemString = fstr; }
61
 
61
 
62
     // Implementation-specific:
62
     // Implementation-specific:
63
     // Draw an item either selected (pre_char) or not (space) with post_char
63
     // Draw an item either selected (pre_char) or not (space) with post_char
64
     // Menus may set up itemIndex, itemString and pass them to string-building or string-emitting functions
64
     // Menus may set up itemIndex, itemString and pass them to string-building or string-emitting functions
65
-    static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char);
65
+    static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char);
66
 
66
 
67
     // Draw an item either selected ('>') or not (space) with post_char
67
     // Draw an item either selected ('>') or not (space) with post_char
68
-    FORCE_INLINE static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char post_char) {
69
-      _draw(sel, row, pstr, '>', post_char);
68
+    FORCE_INLINE static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char post_char) {
69
+      _draw(sel, row, fstr, '>', post_char);
70
     }
70
     }
71
 };
71
 };
72
 
72
 
73
 // STATIC_ITEM(LABEL,...)
73
 // STATIC_ITEM(LABEL,...)
74
 class MenuItem_static : public MenuItemBase {
74
 class MenuItem_static : public MenuItemBase {
75
   public:
75
   public:
76
-    static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr);
76
+    static void draw(const uint8_t row, FSTR_P const fstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr);
77
 };
77
 };
78
 
78
 
79
 // BACK_ITEM(LABEL)
79
 // BACK_ITEM(LABEL)
80
 class MenuItem_back : public MenuItemBase {
80
 class MenuItem_back : public MenuItemBase {
81
   public:
81
   public:
82
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) {
83
-      _draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]);
82
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr) {
83
+      _draw(sel, row, fstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]);
84
     }
84
     }
85
     // Back Item action goes back one step in history
85
     // Back Item action goes back one step in history
86
-    FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); }
86
+    FORCE_INLINE static void action(FSTR_P const=nullptr) { ui.go_back(); }
87
 };
87
 };
88
 
88
 
89
 // CONFIRM_ITEM(LABEL,Y,N,FY,FN,...),
89
 // CONFIRM_ITEM(LABEL,Y,N,FY,FN,...),
90
 // YESNO_ITEM(LABEL,FY,FN,...)
90
 // YESNO_ITEM(LABEL,FY,FN,...)
91
 class MenuItem_confirm : public MenuItemBase {
91
 class MenuItem_confirm : public MenuItemBase {
92
   public:
92
   public:
93
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
94
-      _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]);
93
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
94
+      _draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]);
95
     }
95
     }
96
     // Implemented for HD44780 and DOGM
96
     // Implemented for HD44780 and DOGM
97
     // Draw the prompt, buttons, and state
97
     // Draw the prompt, buttons, and state
98
     static void draw_select_screen(
98
     static void draw_select_screen(
99
-      PGM_P const yes,            // Right option label
100
-      PGM_P const no,             // Left option label
99
+      FSTR_P const yes,           // Right option label
100
+      FSTR_P const no,            // Left option label
101
       const bool yesno,           // Is "yes" selected?
101
       const bool yesno,           // Is "yes" selected?
102
-      PGM_P const pref,           // Prompt prefix
102
+      FSTR_P const pref,          // Prompt prefix
103
       const char * const string,  // Prompt runtime string
103
       const char * const string,  // Prompt runtime string
104
-      PGM_P const suff            // Prompt suffix
104
+      FSTR_P const suff           // Prompt suffix
105
     );
105
     );
106
     static void select_screen(
106
     static void select_screen(
107
-      PGM_P const yes, PGM_P const no,
107
+      FSTR_P const yes, FSTR_P const no,
108
       selectFunc_t yesFunc, selectFunc_t noFunc,
108
       selectFunc_t yesFunc, selectFunc_t noFunc,
109
-      PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr
109
+      FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr
110
     );
110
     );
111
     static void select_screen(
111
     static void select_screen(
112
-      PGM_P const yes, PGM_P const no,
112
+      FSTR_P const yes, FSTR_P const no,
113
       selectFunc_t yesFunc, selectFunc_t noFunc,
113
       selectFunc_t yesFunc, selectFunc_t noFunc,
114
-      PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr
114
+      FSTR_P const pref, FSTR_P const string, FSTR_P const suff=nullptr
115
     ) {
115
     ) {
116
       char str[strlen_P(FTOP(string)) + 1];
116
       char str[strlen_P(FTOP(string)) + 1];
117
       strcpy_P(str, FTOP(string));
117
       strcpy_P(str, FTOP(string));
118
       select_screen(yes, no, yesFunc, noFunc, pref, str, suff);
118
       select_screen(yes, no, yesFunc, noFunc, pref, str, suff);
119
     }
119
     }
120
     // Shortcut for prompt with "NO"/ "YES" labels
120
     // Shortcut for prompt with "NO"/ "YES" labels
121
-    FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) {
122
-      select_screen(GET_TEXT(MSG_YES), GET_TEXT(MSG_NO), yesFunc, noFunc, pref, string, suff);
121
+    FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr) {
122
+      select_screen(GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO), yesFunc, noFunc, pref, string, suff);
123
     }
123
     }
124
 };
124
 };
125
 
125
 
148
     // The action() method acts like the instantiator. The entire lifespan
148
     // The action() method acts like the instantiator. The entire lifespan
149
     // of a menu item is within its declaration, so all these values decompose
149
     // of a menu item is within its declaration, so all these values decompose
150
     // into behavior and unused items get optimized out.
150
     // into behavior and unused items get optimized out.
151
-    static PGM_P editLabel;
151
+    static FSTR_P editLabel;
152
     static void *editValue;
152
     static void *editValue;
153
     static int32_t minEditValue, maxEditValue;  // Encoder value range
153
     static int32_t minEditValue, maxEditValue;  // Encoder value range
154
     static screenFunc_t callbackFunc;
154
     static screenFunc_t callbackFunc;
157
     typedef const char* (*strfunc_t)(const int32_t);
157
     typedef const char* (*strfunc_t)(const int32_t);
158
     typedef void (*loadfunc_t)(void *, const int32_t);
158
     typedef void (*loadfunc_t)(void *, const int32_t);
159
     static void goto_edit_screen(
159
     static void goto_edit_screen(
160
-      PGM_P const el,         // Edit label
160
+      FSTR_P const el,        // Edit label
161
       void * const ev,        // Edit value pointer
161
       void * const ev,        // Edit value pointer
162
       const int32_t minv,     // Encoder minimum
162
       const int32_t minv,     // Encoder minimum
163
       const int32_t maxv,     // Encoder maximum
163
       const int32_t maxv,     // Encoder maximum
170
   public:
170
   public:
171
     // Implementation-specific:
171
     // Implementation-specific:
172
     // Draw the current item at specified row with edit data
172
     // Draw the current item at specified row with edit data
173
-    static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm=false);
173
+    static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm=false);
174
+
175
+    static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const inStr) {
176
+      draw(sel, row, fstr, FTOP(inStr), true);
177
+    }
174
 
178
 
175
     // Implementation-specific:
179
     // Implementation-specific:
176
     // This low-level method is good to draw from anywhere
180
     // This low-level method is good to draw from anywhere
177
-    static void draw_edit_screen(PGM_P const pstr, const char * const value);
181
+    static void draw_edit_screen(FSTR_P const fstr, const char * const value);
178
 
182
 
179
     // This method is for the current menu item
183
     // This method is for the current menu item
180
     static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); }
184
     static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); }
185
   class MenuItem_sdbase {
189
   class MenuItem_sdbase {
186
     public:
190
     public:
187
       // Implemented for HD44780 and DOGM
191
       // Implemented for HD44780 and DOGM
188
-      static void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir);
192
+      static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard, const bool isDir);
189
   };
193
   };
190
 #endif
194
 #endif
191
 
195
 

+ 2
- 2
Marlin/src/lcd/menu/menu_advanced.cpp Visa fil

83
   void menu_pwm() {
83
   void menu_pwm() {
84
     START_MENU();
84
     START_MENU();
85
     BACK_ITEM(MSG_ADVANCED_SETTINGS);
85
     BACK_ITEM(MSG_ADVANCED_SETTINGS);
86
-    #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
86
+    #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_F(long5, F(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
87
     #if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y)
87
     #if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y)
88
       EDIT_CURRENT_PWM(STR_A STR_B, 0);
88
       EDIT_CURRENT_PWM(STR_A STR_B, 0);
89
     #endif
89
     #endif
703
     CONFIRM_ITEM(MSG_INIT_EEPROM,
703
     CONFIRM_ITEM(MSG_INIT_EEPROM,
704
       MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
704
       MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
705
       ui.init_eeprom, nullptr,
705
       ui.init_eeprom, nullptr,
706
-      GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?")
706
+      GET_TEXT_F(MSG_INIT_EEPROM), (const char *)nullptr, F("?")
707
     );
707
     );
708
   #endif
708
   #endif
709
 
709
 

+ 9
- 9
Marlin/src/lcd/menu/menu_bed_corners.cpp Visa fil

168
 
168
 
169
     TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU)); // Set up the font for extra info
169
     TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU)); // Set up the font for extra info
170
 
170
 
171
-    MenuItem_static::draw(0, GET_TEXT(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading
171
+    MenuItem_static::draw(0, GET_TEXT_F(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading
172
 
172
 
173
     uint8_t cy = TERN(TFT_COLOR_UI, 3, LCD_HEIGHT - 1), y = LCD_ROW_Y(cy);
173
     uint8_t cy = TERN(TFT_COLOR_UI, 3, LCD_HEIGHT - 1), y = LCD_ROW_Y(cy);
174
 
174
 
197
   void _lcd_draw_raise() {
197
   void _lcd_draw_raise() {
198
     if (!ui.should_draw()) return;
198
     if (!ui.should_draw()) return;
199
     MenuItem_confirm::select_screen(
199
     MenuItem_confirm::select_screen(
200
-        GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP)
200
+        GET_TEXT_F(MSG_BUTTON_DONE), GET_TEXT_F(MSG_BUTTON_SKIP)
201
       , []{ corner_probing_done = true; wait_for_probe = false; }
201
       , []{ corner_probing_done = true; wait_for_probe = false; }
202
       , []{ wait_for_probe = false; }
202
       , []{ wait_for_probe = false; }
203
-      , GET_TEXT(MSG_BED_TRAMMING_RAISE)
203
+      , GET_TEXT_F(MSG_BED_TRAMMING_RAISE)
204
       , (const char*)nullptr, NUL_STR
204
       , (const char*)nullptr, NUL_STR
205
     );
205
     );
206
   }
206
   }
208
   void _lcd_draw_level_prompt() {
208
   void _lcd_draw_level_prompt() {
209
     if (!ui.should_draw()) return;
209
     if (!ui.should_draw()) return;
210
     MenuItem_confirm::select_screen(
210
     MenuItem_confirm::select_screen(
211
-        GET_TEXT(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)),
212
-        TERN(HAS_LEVELING, GET_TEXT(MSG_BUTTON_BACK), nullptr)
211
+        GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)),
212
+        TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr)
213
       , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); }
213
       , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); }
214
       , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{})
214
       , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{})
215
-      , GET_TEXT(MSG_BED_TRAMMING_IN_RANGE)
215
+      , GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE)
216
       , (const char*)nullptr, NUL_STR
216
       , (const char*)nullptr, NUL_STR
217
     );
217
     );
218
   }
218
   }
332
     bed_corner = 0;
332
     bed_corner = 0;
333
     ui.goto_screen([]{
333
     ui.goto_screen([]{
334
       MenuItem_confirm::select_screen(
334
       MenuItem_confirm::select_screen(
335
-          GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE)
335
+          GET_TEXT_F(MSG_BUTTON_NEXT), GET_TEXT_F(MSG_BUTTON_DONE)
336
         , _lcd_goto_next_corner
336
         , _lcd_goto_next_corner
337
         , []{
337
         , []{
338
             line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done
338
             line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done
339
             TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
339
             TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
340
             ui.goto_previous_screen_no_defer();
340
             ui.goto_previous_screen_no_defer();
341
           }
341
           }
342
-        , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER))
343
-        , (const char*)nullptr, PSTR("?")
342
+        , GET_TEXT_F(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER))
343
+        , (const char*)nullptr, F("?")
344
       );
344
       );
345
     });
345
     });
346
     ui.set_selection(true);
346
     ui.set_selection(true);

+ 7
- 7
Marlin/src/lcd/menu/menu_bed_leveling.cpp Visa fil

71
       #if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING)
71
       #if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING)
72
         // Display "Done" screen and wait for moves to complete
72
         // Display "Done" screen and wait for moves to complete
73
         line_to_z(Z_AFTER_PROBING);
73
         line_to_z(Z_AFTER_PROBING);
74
-        ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE));
74
+        ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE));
75
       #endif
75
       #endif
76
       ui.goto_previous_screen_no_defer();
76
       ui.goto_previous_screen_no_defer();
77
       ui.completion_feedback();
77
       ui.completion_feedback();
78
     }
78
     }
79
-    if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE));
79
+    if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_LEVEL_BED_DONE));
80
     ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
80
     ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
81
   }
81
   }
82
 
82
 
127
     //
127
     //
128
     if (ui.should_draw()) {
128
     if (ui.should_draw()) {
129
       const float v = current_position.z;
129
       const float v = current_position.z;
130
-      MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+'));
130
+      MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+'));
131
     }
131
     }
132
   }
132
   }
133
 
133
 
138
     if (ui.should_draw()) {
138
     if (ui.should_draw()) {
139
       char msg[10];
139
       char msg[10];
140
       sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points);
140
       sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points);
141
-      MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
141
+      MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg);
142
     }
142
     }
143
     ui.refresh(LCDVIEW_CALL_NO_REDRAW);
143
     ui.refresh(LCDVIEW_CALL_NO_REDRAW);
144
     if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z);
144
     if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z);
165
   //
165
   //
166
   void _lcd_level_bed_homing_done() {
166
   void _lcd_level_bed_homing_done() {
167
     if (ui.should_draw()) {
167
     if (ui.should_draw()) {
168
-      MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING));
168
+      MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING));
169
       // Color UI needs a control to detect a touch
169
       // Color UI needs a control to detect a touch
170
       #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
170
       #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
171
         touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
171
         touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
243
 
243
 
244
   // Auto Home if not using manual probing
244
   // Auto Home if not using manual probing
245
   #if NONE(PROBE_MANUALLY, MESH_BED_LEVELING)
245
   #if NONE(PROBE_MANUALLY, MESH_BED_LEVELING)
246
-    if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
246
+    if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
247
   #endif
247
   #endif
248
 
248
 
249
   // Level Bed
249
   // Level Bed
252
     SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue);
252
     SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue);
253
   #else
253
   #else
254
     // Automatic leveling can just run the G-code
254
     // Automatic leveling can just run the G-code
255
-    GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G29N"));
255
+    GCODES_ITEM(MSG_LEVEL_BED, is_homed ? F("G29") : F("G29N"));
256
   #endif
256
   #endif
257
 
257
 
258
   #if ENABLED(MESH_EDIT_MENU)
258
   #if ENABLED(MESH_EDIT_MENU)

+ 1
- 1
Marlin/src/lcd/menu/menu_cancelobject.cpp Visa fil

48
       ui.goto_previous_screen();
48
       ui.goto_previous_screen();
49
     },
49
     },
50
     nullptr,
50
     nullptr,
51
-    GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?")
51
+    GET_TEXT_F(MSG_CANCEL_OBJECT), item_num, F("?")
52
   );
52
   );
53
 }
53
 }
54
 
54
 

+ 25
- 25
Marlin/src/lcd/menu/menu_configuration.cpp Visa fil

78
     bar_percent += (int8_t)ui.encoderPosition;
78
     bar_percent += (int8_t)ui.encoderPosition;
79
     LIMIT(bar_percent, 0, 100);
79
     LIMIT(bar_percent, 0, 100);
80
     ui.encoderPosition = 0;
80
     ui.encoderPosition = 0;
81
-    MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT);
81
+    MenuItem_static::draw(0, GET_TEXT_F(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT);
82
     lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%');
82
     lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%');
83
     lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
83
     lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
84
   }
84
   }
137
     #include "../../gcode/queue.h"
137
     #include "../../gcode/queue.h"
138
 
138
 
139
     void menu_toolchange_migration() {
139
     void menu_toolchange_migration() {
140
-      PGM_P const msg_migrate = GET_TEXT(MSG_TOOL_MIGRATION_SWAP);
140
+      FSTR_P const msg_migrate = GET_TEXT_F(MSG_TOOL_MIGRATION_SWAP);
141
 
141
 
142
       START_MENU();
142
       START_MENU();
143
       BACK_ITEM(MSG_CONFIGURATION);
143
       BACK_ITEM(MSG_CONFIGURATION);
149
       // Migrate to a chosen extruder
149
       // Migrate to a chosen extruder
150
       EXTRUDER_LOOP() {
150
       EXTRUDER_LOOP() {
151
         if (e != active_extruder) {
151
         if (e != active_extruder) {
152
-          ACTION_ITEM_N_P(e, msg_migrate, []{
152
+          ACTION_ITEM_N_F(e, msg_migrate, []{
153
             char cmd[12];
153
             char cmd[12];
154
             sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex));
154
             sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex));
155
             queue.inject(cmd);
155
             queue.inject(cmd);
199
     START_MENU();
199
     START_MENU();
200
     BACK_ITEM(MSG_CONFIGURATION);
200
     BACK_ITEM(MSG_CONFIGURATION);
201
 
201
 
202
-    GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK,  PSTR("M605S1\nG28X\nG1X0"));
202
+    GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK,  F("M605S1\nG28X\nG1X0"));
203
     GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28
203
     GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28
204
-      ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0")         // If Y or Z is not homed, do a full G28 first
205
-      : PSTR("M605S1\nT0\nM605S2\nG28X\nG1X0")
204
+      ? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0")         // If Y or Z is not homed, do a full G28 first
205
+      : F("M605S1\nT0\nM605S2\nG28X\nG1X0")
206
     );
206
     );
207
     GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28
207
     GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28
208
-      ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first
209
-      : PSTR("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3")
208
+      ? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first
209
+      : F("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3")
210
     );
210
     );
211
-    GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605S0\nG28X"));
211
+    GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, F("M605S0\nG28X"));
212
 
212
 
213
     EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20);
213
     EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20);
214
 
214
 
246
       EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode);
246
       EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode);
247
     #endif
247
     #endif
248
     #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
248
     #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
249
-      CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
250
-      CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
249
+      CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
250
+      CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
251
       ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store);
251
       ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store);
252
-      CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
253
-      CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
252
+      CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
253
+      CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
254
       ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report);
254
       ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report);
255
     #endif
255
     #endif
256
     END_MENU();
256
     END_MENU();
264
     ui.defer_status_screen();
264
     ui.defer_status_screen();
265
     START_MENU();
265
     START_MENU();
266
     BACK_ITEM(MSG_CONFIGURATION);
266
     BACK_ITEM(MSG_CONFIGURATION);
267
-    GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0"));
267
+    GCODES_ITEM(MSG_TOUCHMI_INIT, F("M851 Z0\nG28\nG1 F200 Z0"));
268
     SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
268
     SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
269
-    GCODES_ITEM(MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10"));
270
-    GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0"));
269
+    GCODES_ITEM(MSG_TOUCHMI_SAVE, F("M500\nG1 F200 Z10"));
270
+    GCODES_ITEM(MSG_TOUCHMI_ZTEST, F("G28\nG1 F200 Z0"));
271
     END_MENU();
271
     END_MENU();
272
   }
272
   }
273
 
273
 
329
     #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
329
     #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
330
     const uint8_t m = MenuItemBase::itemIndex;
330
     const uint8_t m = MenuItemBase::itemIndex;
331
     START_MENU();
331
     START_MENU();
332
-    STATIC_ITEM_P(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT);
332
+    STATIC_ITEM_F(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT);
333
     BACK_ITEM(MSG_CONFIGURATION);
333
     BACK_ITEM(MSG_CONFIGURATION);
334
     #if HAS_FAN
334
     #if HAS_FAN
335
       editable.uint8 = uint8_t(ui.material_preset[m].fan_speed);
335
       editable.uint8 = uint8_t(ui.material_preset[m].fan_speed);
369
       #define _DONE_SCRIPT ""
369
       #define _DONE_SCRIPT ""
370
     #endif
370
     #endif
371
     #define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(F(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
371
     #define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(F(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
372
-    #define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N));
373
-    #define _CUSTOM_ITEM_CONF_CONFIRM(N)               \
374
-      SUBMENU_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), []{ \
375
-          MenuItem_confirm::confirm_screen(            \
376
-            GCODE_LAMBDA_CONF(N), nullptr,             \
377
-            PSTR(CONFIG_MENU_ITEM_##N##_DESC "?")      \
378
-          );                                           \
372
+    #define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_F(F(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N));
373
+    #define _CUSTOM_ITEM_CONF_CONFIRM(N)            \
374
+      SUBMENU_F(F(CONFIG_MENU_ITEM_##N##_DESC), []{ \
375
+          MenuItem_confirm::confirm_screen(         \
376
+            GCODE_LAMBDA_CONF(N), nullptr,          \
377
+            F(CONFIG_MENU_ITEM_##N##_DESC "?")      \
378
+          );                                        \
379
         })
379
         })
380
 
380
 
381
     #define CUSTOM_ITEM_CONF(N) do{ \
381
     #define CUSTOM_ITEM_CONF(N) do{ \
483
   #if ENABLED(CUSTOM_MENU_CONFIG)
483
   #if ENABLED(CUSTOM_MENU_CONFIG)
484
     if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) {
484
     if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) {
485
       #ifdef CUSTOM_MENU_CONFIG_TITLE
485
       #ifdef CUSTOM_MENU_CONFIG_TITLE
486
-        SUBMENU_P(PSTR(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration);
486
+        SUBMENU_F(F(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration);
487
       #else
487
       #else
488
         SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_configuration);
488
         SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_configuration);
489
       #endif
489
       #endif

+ 3
- 3
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Visa fil

107
   START_MENU();
107
   START_MENU();
108
   BACK_ITEM(MSG_DELTA_CALIBRATE);
108
   BACK_ITEM(MSG_DELTA_CALIBRATE);
109
   EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings);
109
   EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings);
110
-  #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings)
110
+  #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings)
111
   EDIT_ENDSTOP_ADJ("Ex", a);
111
   EDIT_ENDSTOP_ADJ("Ex", a);
112
   EDIT_ENDSTOP_ADJ("Ey", b);
112
   EDIT_ENDSTOP_ADJ("Ey", b);
113
   EDIT_ENDSTOP_ADJ("Ez", c);
113
   EDIT_ENDSTOP_ADJ("Ez", c);
114
   EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings);
114
   EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings);
115
-  #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings)
115
+  #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings)
116
   EDIT_ANGLE_TRIM("Tx", a);
116
   EDIT_ANGLE_TRIM("Tx", a);
117
   EDIT_ANGLE_TRIM("Ty", b);
117
   EDIT_ANGLE_TRIM("Ty", b);
118
   EDIT_ANGLE_TRIM("Tz", c);
118
   EDIT_ANGLE_TRIM("Tz", c);
129
   BACK_ITEM(MSG_MAIN);
129
   BACK_ITEM(MSG_MAIN);
130
 
130
 
131
   #if ENABLED(DELTA_AUTO_CALIBRATION)
131
   #if ENABLED(DELTA_AUTO_CALIBRATION)
132
-    GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
132
+    GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, F("G33"));
133
     #if ENABLED(EEPROM_SETTINGS)
133
     #if ENABLED(EEPROM_SETTINGS)
134
       ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
134
       ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
135
       ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
135
       ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);

+ 52
- 52
Marlin/src/lcd/menu/menu_filament.cpp Visa fil

45
 static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT
45
 static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT
46
 static int8_t _change_filament_extruder; // = 0
46
 static int8_t _change_filament_extruder; // = 0
47
 
47
 
48
-inline PGM_P _change_filament_command() {
48
+inline FSTR_P _change_filament_command() {
49
   switch (_change_filament_mode) {
49
   switch (_change_filament_mode) {
50
-    case PAUSE_MODE_LOAD_FILAMENT:    return PSTR("M701 T%d");
50
+    case PAUSE_MODE_LOAD_FILAMENT:    return F("M701 T%d");
51
     case PAUSE_MODE_UNLOAD_FILAMENT:  return _change_filament_extruder >= 0
51
     case PAUSE_MODE_UNLOAD_FILAMENT:  return _change_filament_extruder >= 0
52
-                                           ? PSTR("M702 T%d") : PSTR("M702 ;%d");
52
+                                           ? F("M702 T%d") : F("M702 ;%d");
53
     case PAUSE_MODE_CHANGE_FILAMENT:
53
     case PAUSE_MODE_CHANGE_FILAMENT:
54
     case PAUSE_MODE_PAUSE_PRINT:
54
     case PAUSE_MODE_PAUSE_PRINT:
55
     default: break;
55
     default: break;
56
   }
56
   }
57
-  return PSTR("M600 B0 T%d");
57
+  return F("M600 B0 T%d");
58
 }
58
 }
59
 
59
 
60
 // Initiate Filament Load/Unload/Change at the specified temperature
60
 // Initiate Filament Load/Unload/Change at the specified temperature
61
 static void _change_filament_with_temp(const uint16_t celsius) {
61
 static void _change_filament_with_temp(const uint16_t celsius) {
62
   char cmd[11];
62
   char cmd[11];
63
-  sprintf_P(cmd, _change_filament_command(), _change_filament_extruder);
63
+  sprintf_P(cmd, FTOP(_change_filament_command()), _change_filament_extruder);
64
   thermalManager.setTargetHotend(celsius, _change_filament_extruder);
64
   thermalManager.setTargetHotend(celsius, _change_filament_extruder);
65
   queue.inject(cmd);
65
   queue.inject(cmd);
66
 }
66
 }
77
 // Menu to choose the temperature and start Filament Change
77
 // Menu to choose the temperature and start Filament Change
78
 //
78
 //
79
 
79
 
80
-inline PGM_P change_filament_header(const PauseMode mode) {
80
+inline FSTR_P change_filament_header(const PauseMode mode) {
81
   switch (mode) {
81
   switch (mode) {
82
-    case PAUSE_MODE_LOAD_FILAMENT:   return GET_TEXT(MSG_FILAMENTLOAD);
83
-    case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTUNLOAD);
82
+    case PAUSE_MODE_LOAD_FILAMENT:   return GET_TEXT_F(MSG_FILAMENTLOAD);
83
+    case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENTUNLOAD);
84
     default: break;
84
     default: break;
85
   }
85
   }
86
-  return GET_TEXT(MSG_FILAMENTCHANGE);
86
+  return GET_TEXT_F(MSG_FILAMENTCHANGE);
87
 }
87
 }
88
 
88
 
89
 void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
89
 void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
91
   _change_filament_extruder = extruder;
91
   _change_filament_extruder = extruder;
92
   const int8_t old_index = MenuItemBase::itemIndex;
92
   const int8_t old_index = MenuItemBase::itemIndex;
93
   START_MENU();
93
   START_MENU();
94
-  if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT);
94
+  if (LCD_HEIGHT >= 4) STATIC_ITEM_F(change_filament_header(mode), SS_DEFAULT|SS_INVERT);
95
   BACK_ITEM(MSG_BACK);
95
   BACK_ITEM(MSG_BACK);
96
   #if HAS_PREHEAT
96
   #if HAS_PREHEAT
97
     LOOP_L_N(m, PREHEAT_COUNT)
97
     LOOP_L_N(m, PREHEAT_COUNT)
132
 
132
 
133
     // Change filament
133
     // Change filament
134
     #if E_STEPPERS == 1
134
     #if E_STEPPERS == 1
135
-      PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE);
135
+      FSTR_P const msg = GET_TEXT_F(MSG_FILAMENTCHANGE);
136
       if (thermalManager.targetTooColdToExtrude(active_extruder))
136
       if (thermalManager.targetTooColdToExtrude(active_extruder))
137
-        SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
137
+        SUBMENU_F(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
138
       else
138
       else
139
-        GCODES_ITEM_P(msg, PSTR("M600 B0"));
139
+        GCODES_ITEM_F(msg, F("M600 B0"));
140
     #else
140
     #else
141
-      PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E);
141
+      FSTR_P const msg = GET_TEXT_F(MSG_FILAMENTCHANGE_E);
142
       LOOP_L_N(s, E_STEPPERS) {
142
       LOOP_L_N(s, E_STEPPERS) {
143
         if (thermalManager.targetTooColdToExtrude(s))
143
         if (thermalManager.targetTooColdToExtrude(s))
144
-          SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
144
+          SUBMENU_N_F(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
145
         else {
145
         else {
146
-          ACTION_ITEM_N_P(s, msg, []{
146
+          ACTION_ITEM_N_F(s, msg, []{
147
             PGM_P const cmdpstr = PSTR("M600 B0 T%i");
147
             PGM_P const cmdpstr = PSTR("M600 B0 T%i");
148
             char cmd[strlen_P(cmdpstr) + 3 + 1];
148
             char cmd[strlen_P(cmdpstr) + 3 + 1];
149
             sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex));
149
             sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex));
157
       if (!is_busy) {
157
       if (!is_busy) {
158
         // Load filament
158
         // Load filament
159
         #if E_STEPPERS == 1
159
         #if E_STEPPERS == 1
160
-          PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD);
160
+          FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD);
161
           if (thermalManager.targetTooColdToExtrude(active_extruder))
161
           if (thermalManager.targetTooColdToExtrude(active_extruder))
162
-            SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
162
+            SUBMENU_F(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
163
           else
163
           else
164
-            GCODES_ITEM_P(msg_load, PSTR("M701"));
164
+            GCODES_ITEM_F(msg_load, F("M701"));
165
         #else
165
         #else
166
-          PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E);
166
+          FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD_E);
167
           LOOP_L_N(s, E_STEPPERS) {
167
           LOOP_L_N(s, E_STEPPERS) {
168
             if (thermalManager.targetTooColdToExtrude(s))
168
             if (thermalManager.targetTooColdToExtrude(s))
169
-              SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
169
+              SUBMENU_N_F(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
170
             else {
170
             else {
171
-              ACTION_ITEM_N_P(s, msg_load, []{
171
+              ACTION_ITEM_N_F(s, msg_load, []{
172
                 char cmd[12];
172
                 char cmd[12];
173
                 sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex));
173
                 sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex));
174
                 queue.inject(cmd);
174
                 queue.inject(cmd);
179
 
179
 
180
         // Unload filament
180
         // Unload filament
181
         #if E_STEPPERS == 1
181
         #if E_STEPPERS == 1
182
-          PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD);
182
+          FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD);
183
           if (thermalManager.targetTooColdToExtrude(active_extruder))
183
           if (thermalManager.targetTooColdToExtrude(active_extruder))
184
-            SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
184
+            SUBMENU_F(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
185
           else
185
           else
186
-            GCODES_ITEM_P(msg_unload, PSTR("M702"));
186
+            GCODES_ITEM_F(msg_unload, F("M702"));
187
         #else
187
         #else
188
           #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
188
           #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
189
             if (too_cold)
189
             if (too_cold)
190
               SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); });
190
               SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); });
191
             else
191
             else
192
-              GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702"));
192
+              GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, F("M702"));
193
           #endif
193
           #endif
194
-          PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E);
194
+          FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD_E);
195
           LOOP_L_N(s, E_STEPPERS) {
195
           LOOP_L_N(s, E_STEPPERS) {
196
             if (thermalManager.targetTooColdToExtrude(s))
196
             if (thermalManager.targetTooColdToExtrude(s))
197
-              SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
197
+              SUBMENU_N_F(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
198
             else {
198
             else {
199
-              ACTION_ITEM_N_P(s, msg_unload, []{
199
+              ACTION_ITEM_N_F(s, msg_unload, []{
200
                 char cmd[12];
200
                 char cmd[12];
201
                 sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex));
201
                 sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex));
202
                 queue.inject(cmd);
202
                 queue.inject(cmd);
221
 
221
 
222
 static uint8_t hotend_status_extruder = 0;
222
 static uint8_t hotend_status_extruder = 0;
223
 
223
 
224
-static PGM_P pause_header() {
224
+static FSTR_P pause_header() {
225
   switch (pause_mode) {
225
   switch (pause_mode) {
226
-    case PAUSE_MODE_CHANGE_FILAMENT:  return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER);
227
-    case PAUSE_MODE_LOAD_FILAMENT:    return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_LOAD);
228
-    case PAUSE_MODE_UNLOAD_FILAMENT:  return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_UNLOAD);
226
+    case PAUSE_MODE_CHANGE_FILAMENT:  return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER);
227
+    case PAUSE_MODE_LOAD_FILAMENT:    return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_LOAD);
228
+    case PAUSE_MODE_UNLOAD_FILAMENT:  return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_UNLOAD);
229
     default: break;
229
     default: break;
230
   }
230
   }
231
-  return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE);
231
+  return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_PAUSE);
232
 }
232
 }
233
 
233
 
234
 // Portions from STATIC_ITEM...
234
 // Portions from STATIC_ITEM...
235
 #define HOTEND_STATUS_ITEM() do { \
235
 #define HOTEND_STATUS_ITEM() do { \
236
   if (_menuLineNr == _thisItemNr) { \
236
   if (_menuLineNr == _thisItemNr) { \
237
     if (ui.should_draw()) { \
237
     if (ui.should_draw()) { \
238
-      IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \
238
+      IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \
239
       ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \
239
       ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \
240
     } \
240
     } \
241
     if (_skipStatic && encoderLine <= _thisItemNr) { \
241
     if (_skipStatic && encoderLine <= _thisItemNr) { \
273
 //
273
 //
274
 // Warning: msg must have three null bytes to delimit lines!
274
 // Warning: msg must have three null bytes to delimit lines!
275
 //
275
 //
276
-void _lcd_pause_message(PGM_P const msg) {
277
-  PGM_P const msg1 = msg;
276
+void _lcd_pause_message(FSTR_P const msg) {
277
+  PGM_P const msg1 = FTOP(msg);
278
   PGM_P const msg2 = msg1 + strlen_P(msg1) + 1;
278
   PGM_P const msg2 = msg1 + strlen_P(msg1) + 1;
279
   PGM_P const msg3 = msg2 + strlen_P(msg2) + 1;
279
   PGM_P const msg3 = msg2 + strlen_P(msg2) + 1;
280
   const bool has2 = msg2[0], has3 = msg3[0],
280
   const bool has2 = msg2[0], has3 = msg3[0],
281
              skip1 = !has2 && (LCD_HEIGHT) >= 5;
281
              skip1 = !has2 && (LCD_HEIGHT) >= 5;
282
 
282
 
283
   START_SCREEN();
283
   START_SCREEN();
284
-  STATIC_ITEM_P(pause_header(), SS_DEFAULT|SS_INVERT);          // 1: Header
284
+  STATIC_ITEM_F(pause_header(), SS_DEFAULT|SS_INVERT);          // 1: Header
285
   if (skip1) SKIP_ITEM();                                       // Move a single-line message down
285
   if (skip1) SKIP_ITEM();                                       // Move a single-line message down
286
-  STATIC_ITEM_P(msg1);                                          // 2: Message Line 1
287
-  if (has2) STATIC_ITEM_P(msg2);                                // 3: Message Line 2
288
-  if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3);           // 4: Message Line 3 (if LCD has 5 lines)
286
+  STATIC_ITEM_F(FPSTR(msg1));                                   // 2: Message Line 1
287
+  if (has2) STATIC_ITEM_F(FPSTR(msg2));                         // 3: Message Line 2
288
+  if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_F(FPSTR(msg3));    // 4: Message Line 3 (if LCD has 5 lines)
289
   if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM();  // Push Hotend Status down, if needed
289
   if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM();  // Push Hotend Status down, if needed
290
   HOTEND_STATUS_ITEM();                                         // 5: Hotend Status
290
   HOTEND_STATUS_ITEM();                                         // 5: Hotend Status
291
   END_SCREEN();
291
   END_SCREEN();
292
 }
292
 }
293
 
293
 
294
-void lcd_pause_parking_message()  { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_PARKING));     }
295
-void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INIT));    }
296
-void lcd_pause_unload_message()   { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD));  }
297
-void lcd_pause_heating_message()  { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); }
298
-void lcd_pause_heat_message()     { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT));    }
299
-void lcd_pause_insert_message()   { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT));  }
300
-void lcd_pause_load_message()     { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD));    }
301
-void lcd_pause_waiting_message()  { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING));  }
302
-void lcd_pause_resume_message()   { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME));  }
294
+void lcd_pause_parking_message()  { _lcd_pause_message(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING));     }
295
+void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT));    }
296
+void lcd_pause_unload_message()   { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD));  }
297
+void lcd_pause_heating_message()  { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); }
298
+void lcd_pause_heat_message()     { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT));    }
299
+void lcd_pause_insert_message()   { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT));  }
300
+void lcd_pause_load_message()     { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD));    }
301
+void lcd_pause_waiting_message()  { _lcd_pause_message(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING));  }
302
+void lcd_pause_resume_message()   { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME));  }
303
 
303
 
304
 void lcd_pause_purge_message() {
304
 void lcd_pause_purge_message() {
305
   #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
305
   #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
306
-    _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE));
306
+    _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE));
307
   #else
307
   #else
308
-    _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE));
308
+    _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE));
309
   #endif
309
   #endif
310
 }
310
 }
311
 
311
 

+ 28
- 28
Marlin/src/lcd/menu/menu_info.cpp Visa fil

35
 #endif
35
 #endif
36
 
36
 
37
 #define VALUE_ITEM(MSG, VALUE, STYL)    do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy(msg + 2, VALUE); STATIC_ITEM(MSG, STYL, msg); }while(0)
37
 #define VALUE_ITEM(MSG, VALUE, STYL)    do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy(msg + 2, VALUE); STATIC_ITEM(MSG, STYL, msg); }while(0)
38
-#define VALUE_ITEM_P(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0)
38
+#define VALUE_ITEM_F(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0)
39
 
39
 
40
 #if ENABLED(PRINTCOUNTER)
40
 #if ENABLED(PRINTCOUNTER)
41
 
41
 
56
     VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT);    // Completed  : 666
56
     VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT);    // Completed  : 666
57
 
57
 
58
     STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT);                                              // Total print Time:
58
     STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT);                                              // Total print Time:
59
-    STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer));       // > 99y 364d 23h 59m 59s
59
+    STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer));       // > 99y 364d 23h 59m 59s
60
 
60
 
61
     STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT);                                           // Longest job time:
61
     STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT);                                           // Longest job time:
62
-    STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer));    // > 99y 364d 23h 59m 59s
62
+    STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer));    // > 99y 364d 23h 59m 59s
63
 
63
 
64
     STATIC_ITEM(MSG_INFO_PRINT_FILAMENT, SS_LEFT);                                          // Extruded total:
64
     STATIC_ITEM(MSG_INFO_PRINT_FILAMENT, SS_LEFT);                                          // Extruded total:
65
     sprintf_P(buffer, PSTR("%ld.%im")
65
     sprintf_P(buffer, PSTR("%ld.%im")
66
       , long(stats.filamentUsed / 1000)
66
       , long(stats.filamentUsed / 1000)
67
       , int16_t(stats.filamentUsed / 100) % 10
67
       , int16_t(stats.filamentUsed / 100) % 10
68
     );
68
     );
69
-    STATIC_ITEM_P(PSTR("> "), SS_LEFT, buffer);                                             // > 125m
69
+    STATIC_ITEM_F(F("> "), SS_LEFT, buffer);                                             // > 125m
70
 
70
 
71
     #if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0
71
     #if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0
72
       strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN));
72
       strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN));
73
     #endif
73
     #endif
74
 
74
 
75
     #if SERVICE_INTERVAL_1 > 0
75
     #if SERVICE_INTERVAL_1 > 0
76
-      STATIC_ITEM_P(PSTR(SERVICE_NAME_1 " "), SS_LEFT, buffer);                             // Service X in:
77
-      STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer));  // > 7d 12h 11m 10s
76
+      STATIC_ITEM_F(F(SERVICE_NAME_1 " "), SS_LEFT, buffer);                             // Service X in:
77
+      STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer));  // > 7d 12h 11m 10s
78
     #endif
78
     #endif
79
 
79
 
80
     #if SERVICE_INTERVAL_2 > 0
80
     #if SERVICE_INTERVAL_2 > 0
81
-      STATIC_ITEM_P(PSTR(SERVICE_NAME_2 " "), SS_LEFT, buffer);
82
-      STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer));
81
+      STATIC_ITEM_F(F(SERVICE_NAME_2 " "), SS_LEFT, buffer);
82
+      STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer));
83
     #endif
83
     #endif
84
 
84
 
85
     #if SERVICE_INTERVAL_3 > 0
85
     #if SERVICE_INTERVAL_3 > 0
86
-      STATIC_ITEM_P(PSTR(SERVICE_NAME_3 " "), SS_LEFT, buffer);
87
-      STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer));
86
+      STATIC_ITEM_F(F(SERVICE_NAME_3 " "), SS_LEFT, buffer);
87
+      STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer));
88
     #endif
88
     #endif
89
 
89
 
90
     END_SCREEN();
90
     END_SCREEN();
103
   #if HAS_EXTRUDERS
103
   #if HAS_EXTRUDERS
104
     #define THERMISTOR_ID TEMP_SENSOR_0
104
     #define THERMISTOR_ID TEMP_SENSOR_0
105
     #include "../thermistornames.h"
105
     #include "../thermistornames.h"
106
-    STATIC_ITEM_P(PSTR(STR_E0 ": " THERMISTOR_NAME), SS_INVERT);
106
+    STATIC_ITEM_F(F(STR_E0 ": " THERMISTOR_NAME), SS_INVERT);
107
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT);
107
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT);
108
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT);
108
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT);
109
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
109
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
113
     #undef THERMISTOR_ID
113
     #undef THERMISTOR_ID
114
     #define THERMISTOR_ID TEMP_SENSOR_1
114
     #define THERMISTOR_ID TEMP_SENSOR_1
115
     #include "../thermistornames.h"
115
     #include "../thermistornames.h"
116
-    STATIC_ITEM_P(PSTR(STR_E1 ": " THERMISTOR_NAME), SS_INVERT);
116
+    STATIC_ITEM_F(F(STR_E1 ": " THERMISTOR_NAME), SS_INVERT);
117
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT);
117
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT);
118
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT);
118
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT);
119
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
119
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
123
     #undef THERMISTOR_ID
123
     #undef THERMISTOR_ID
124
     #define THERMISTOR_ID TEMP_SENSOR_2
124
     #define THERMISTOR_ID TEMP_SENSOR_2
125
     #include "../thermistornames.h"
125
     #include "../thermistornames.h"
126
-    STATIC_ITEM_P(PSTR(STR_E2 ": " THERMISTOR_NAME), SS_INVERT);
126
+    STATIC_ITEM_F(F(STR_E2 ": " THERMISTOR_NAME), SS_INVERT);
127
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT);
127
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT);
128
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT);
128
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT);
129
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
129
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
133
     #undef THERMISTOR_ID
133
     #undef THERMISTOR_ID
134
     #define THERMISTOR_ID TEMP_SENSOR_3
134
     #define THERMISTOR_ID TEMP_SENSOR_3
135
     #include "../thermistornames.h"
135
     #include "../thermistornames.h"
136
-    STATIC_ITEM_P(PSTR(STR_E3 ": " THERMISTOR_NAME), SS_INVERT);
136
+    STATIC_ITEM_F(F(STR_E3 ": " THERMISTOR_NAME), SS_INVERT);
137
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT);
137
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT);
138
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT);
138
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT);
139
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
139
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
143
     #undef THERMISTOR_ID
143
     #undef THERMISTOR_ID
144
     #define THERMISTOR_ID TEMP_SENSOR_4
144
     #define THERMISTOR_ID TEMP_SENSOR_4
145
     #include "../thermistornames.h"
145
     #include "../thermistornames.h"
146
-    STATIC_ITEM_P(PSTR(STR_E4 ": " THERMISTOR_NAME), SS_INVERT);
146
+    STATIC_ITEM_F(F(STR_E4 ": " THERMISTOR_NAME), SS_INVERT);
147
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT);
147
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT);
148
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT);
148
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT);
149
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
149
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
153
     #undef THERMISTOR_ID
153
     #undef THERMISTOR_ID
154
     #define THERMISTOR_ID TEMP_SENSOR_5
154
     #define THERMISTOR_ID TEMP_SENSOR_5
155
     #include "../thermistornames.h"
155
     #include "../thermistornames.h"
156
-    STATIC_ITEM_P(PSTR(STR_E5 ": " THERMISTOR_NAME), SS_INVERT);
156
+    STATIC_ITEM_F(F(STR_E5 ": " THERMISTOR_NAME), SS_INVERT);
157
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT);
157
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT);
158
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT);
158
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT);
159
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
159
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
163
     #undef THERMISTOR_ID
163
     #undef THERMISTOR_ID
164
     #define THERMISTOR_ID TEMP_SENSOR_6
164
     #define THERMISTOR_ID TEMP_SENSOR_6
165
     #include "../thermistornames.h"
165
     #include "../thermistornames.h"
166
-    STATIC_ITEM_P(PSTR(STR_E6 ": " THERMISTOR_NAME), SS_INVERT);
166
+    STATIC_ITEM_F(F(STR_E6 ": " THERMISTOR_NAME), SS_INVERT);
167
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_LEFT);
167
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_LEFT);
168
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_LEFT);
168
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_LEFT);
169
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
169
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
173
     #undef THERMISTOR_ID
173
     #undef THERMISTOR_ID
174
     #define THERMISTOR_ID TEMP_SENSOR_7
174
     #define THERMISTOR_ID TEMP_SENSOR_7
175
     #include "../thermistornames.h"
175
     #include "../thermistornames.h"
176
-    STATIC_ITEM_P(PSTR(STR_E7 ": " THERMISTOR_NAME), SS_INVERT);
176
+    STATIC_ITEM_F(F(STR_E7 ": " THERMISTOR_NAME), SS_INVERT);
177
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_LEFT);
177
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_LEFT);
178
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_LEFT);
178
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_LEFT);
179
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
179
     STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
183
     #undef THERMISTOR_ID
183
     #undef THERMISTOR_ID
184
     #define THERMISTOR_ID TEMP_SENSOR_BED
184
     #define THERMISTOR_ID TEMP_SENSOR_BED
185
     #include "../thermistornames.h"
185
     #include "../thermistornames.h"
186
-    STATIC_ITEM_P(PSTR("BED: " THERMISTOR_NAME), SS_INVERT);
186
+    STATIC_ITEM_F(F("BED: " THERMISTOR_NAME), SS_INVERT);
187
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT);
187
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT);
188
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT);
188
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT);
189
     STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
189
     STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
193
     #undef THERMISTOR_ID
193
     #undef THERMISTOR_ID
194
     #define THERMISTOR_ID TEMP_SENSOR_CHAMBER
194
     #define THERMISTOR_ID TEMP_SENSOR_CHAMBER
195
     #include "../thermistornames.h"
195
     #include "../thermistornames.h"
196
-    STATIC_ITEM_P(PSTR("CHAM: " THERMISTOR_NAME), SS_INVERT);
196
+    STATIC_ITEM_F(F("CHAM: " THERMISTOR_NAME), SS_INVERT);
197
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT);
197
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT);
198
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT);
198
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT);
199
     STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
199
     STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
203
     #undef THERMISTOR_ID
203
     #undef THERMISTOR_ID
204
     #define THERMISTOR_ID TEMP_SENSOR_COOLER
204
     #define THERMISTOR_ID TEMP_SENSOR_COOLER
205
     #include "../thermistornames.h"
205
     #include "../thermistornames.h"
206
-    STATIC_ITEM_P(PSTR("COOL: " THERMISTOR_NAME), SS_INVERT);
206
+    STATIC_ITEM_F(F("COOL: " THERMISTOR_NAME), SS_INVERT);
207
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(COOLER_MINTEMP), SS_LEFT);
207
     PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(COOLER_MINTEMP), SS_LEFT);
208
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(COOLER_MAXTEMP), SS_LEFT);
208
     PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(COOLER_MAXTEMP), SS_LEFT);
209
     STATIC_ITEM(TERN(WATCH_COOLER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
209
     STATIC_ITEM(TERN(WATCH_COOLER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
219
   if (ui.use_click()) return ui.go_back();
219
   if (ui.use_click()) return ui.go_back();
220
 
220
 
221
   START_SCREEN();
221
   START_SCREEN();
222
-  STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT);      // MyPrinterController
222
+  STATIC_ITEM_F(F(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT);      // MyPrinterController
223
   #ifdef BOARD_WEBSITE_URL
223
   #ifdef BOARD_WEBSITE_URL
224
-    STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT);               // www.my3dprinter.com
224
+    STATIC_ITEM_F(F(BOARD_WEBSITE_URL), SS_LEFT);               // www.my3dprinter.com
225
   #endif
225
   #endif
226
   PSTRING_ITEM(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000
226
   PSTRING_ITEM(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000
227
   PSTRING_ITEM(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER);    // Protocol: 1.0
227
   PSTRING_ITEM(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER);    // Protocol: 1.0
251
   void menu_info_printer() {
251
   void menu_info_printer() {
252
     if (ui.use_click()) return ui.go_back();
252
     if (ui.use_click()) return ui.go_back();
253
     START_SCREEN();
253
     START_SCREEN();
254
-    STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT);              // Marlin
255
-    STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION));                   // x.x.x-Branch
256
-    STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE));              // YYYY-MM-DD HH:MM
257
-    STATIC_ITEM_P(PSTR(MACHINE_NAME), SS_DEFAULT|SS_INVERT);    // My3DPrinter
258
-    STATIC_ITEM_P(PSTR(WEBSITE_URL));                           // www.my3dprinter.com
254
+    STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT);                // Marlin
255
+    STATIC_ITEM_F(F(SHORT_BUILD_VERSION));                        // x.x.x-Branch
256
+    STATIC_ITEM_F(F(STRING_DISTRIBUTION_DATE));                   // YYYY-MM-DD HH:MM
257
+    STATIC_ITEM_F(F(MACHINE_NAME), SS_DEFAULT|SS_INVERT);         // My3DPrinter
258
+    STATIC_ITEM_F(F(WEBSITE_URL));                                // www.my3dprinter.com
259
     PSTRING_ITEM(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2
259
     PSTRING_ITEM(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2
260
     #if HAS_LEVELING
260
     #if HAS_LEVELING
261
       STATIC_ITEM(
261
       STATIC_ITEM(

+ 122
- 122
Marlin/src/lcd/menu/menu_item.h Visa fil

36
 // SUBMENU(LABEL, screen_handler)
36
 // SUBMENU(LABEL, screen_handler)
37
 class MenuItem_submenu : public MenuItemBase {
37
 class MenuItem_submenu : public MenuItemBase {
38
   public:
38
   public:
39
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
40
-      _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]);
39
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
40
+      _draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]);
41
     }
41
     }
42
-    static void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); }
42
+    static void action(FSTR_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); }
43
 };
43
 };
44
 
44
 
45
 // Any menu item that invokes an immediate action
45
 // Any menu item that invokes an immediate action
46
 class MenuItem_button : public MenuItemBase {
46
 class MenuItem_button : public MenuItemBase {
47
   public:
47
   public:
48
     // Button-y Items are selectable lines with no other indicator
48
     // Button-y Items are selectable lines with no other indicator
49
-    static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
50
-      _draw(sel, row, pstr, '>', ' ');
49
+    static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
50
+      _draw(sel, row, fstr, '>', ' ');
51
     }
51
     }
52
 };
52
 };
53
 
53
 
54
 // ACTION_ITEM(LABEL, FUNC)
54
 // ACTION_ITEM(LABEL, FUNC)
55
 class MenuItem_function : public MenuItem_button {
55
 class MenuItem_function : public MenuItem_button {
56
   public:
56
   public:
57
-    //static void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); };
58
-    static void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); };
57
+    //static void action(FSTR_P const, const uint8_t, const menuAction_t func) { (*func)(); };
58
+    static void action(FSTR_P const, const menuAction_t func) { if (func) (*func)(); };
59
 };
59
 };
60
 
60
 
61
 // GCODES_ITEM(LABEL, GCODES)
61
 // GCODES_ITEM(LABEL, GCODES)
62
 class MenuItem_gcode : public MenuItem_button {
62
 class MenuItem_gcode : public MenuItem_button {
63
   public:
63
   public:
64
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
65
-      _draw(sel, row, pstr, '>', ' ');
64
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
65
+      _draw(sel, row, fstr, '>', ' ');
66
     }
66
     }
67
-    static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); }
68
-    static void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); }
67
+    static void action(FSTR_P const, FSTR_P const fgcode) { queue.inject(fgcode); }
68
+    static void action(FSTR_P const fstr, const uint8_t, FSTR_P const fgcode) { action(fstr, fgcode); }
69
 };
69
 };
70
 
70
 
71
 ////////////////////////////////////////////
71
 ////////////////////////////////////////////
82
     static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); }
82
     static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); }
83
     static void load(void *ptr, const int32_t value)  { *((type_t*)ptr) = unscale(value);     }
83
     static void load(void *ptr, const int32_t value)  { *((type_t*)ptr) = unscale(value);     }
84
   public:
84
   public:
85
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t * const data, ...) {
86
-      MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(*(data)));
85
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t * const data, ...) {
86
+      MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(*(data)));
87
     }
87
     }
88
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t (*pget)(), ...) {
89
-      MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(pget()));
88
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t (*pget)(), ...) {
89
+      MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(pget()));
90
     }
90
     }
91
     // Edit screen for this type of item
91
     // Edit screen for this type of item
92
     static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); }
92
     static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); }
93
     static void action(
93
     static void action(
94
-      PGM_P const pstr,                     // Edit label
94
+      FSTR_P const fstr,                    // Edit label
95
       type_t * const ptr,                   // Value pointer
95
       type_t * const ptr,                   // Value pointer
96
       const type_t minValue,                // Value range
96
       const type_t minValue,                // Value range
97
       const type_t maxValue,
97
       const type_t maxValue,
101
       // Make sure minv and maxv fit within int32_t
101
       // Make sure minv and maxv fit within int32_t
102
       const int32_t minv = _MAX(scale(minValue), INT32_MIN),
102
       const int32_t minv = _MAX(scale(minValue), INT32_MIN),
103
                     maxv = _MIN(scale(maxValue), INT32_MAX);
103
                     maxv = _MIN(scale(maxValue), INT32_MAX);
104
-      goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv,
104
+      goto_edit_screen(fstr, ptr, minv, maxv - minv, scale(*ptr) - minv,
105
         edit_screen, callback, live);
105
         edit_screen, callback, live);
106
     }
106
     }
107
 };
107
 };
168
 
168
 
169
 class MenuItem_bool : public MenuEditItemBase {
169
 class MenuItem_bool : public MenuEditItemBase {
170
   public:
170
   public:
171
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const bool onoff) {
172
-      MenuEditItemBase::draw(sel, row, pstr, onoff ? GET_TEXT(MSG_LCD_ON) : GET_TEXT(MSG_LCD_OFF), true);
171
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const bool onoff) {
172
+      MenuEditItemBase::draw(sel, row, fstr, onoff ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF));
173
     }
173
     }
174
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) {
175
-      draw(sel, row, pstr, *data);
174
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, bool * const data, ...) {
175
+      draw(sel, row, fstr, *data);
176
     }
176
     }
177
-    FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const, bool (*pget)(), ...) {
178
-      draw(sel, row, pstr, pget());
177
+    FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const, bool (*pget)(), ...) {
178
+      draw(sel, row, fstr, pget());
179
     }
179
     }
180
-    static void action(PGM_P const pstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) {
180
+    static void action(FSTR_P const fstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) {
181
       *ptr ^= true; ui.refresh();
181
       *ptr ^= true; ui.refresh();
182
       if (callbackFunc) (*callbackFunc)();
182
       if (callbackFunc) (*callbackFunc)();
183
     }
183
     }
250
  *
250
  *
251
  * Examples:
251
  * Examples:
252
  *   BACK_ITEM(MSG_INFO_SCREEN)
252
  *   BACK_ITEM(MSG_INFO_SCREEN)
253
- *     MenuItem_back::action(plabel, ...)
254
- *     MenuItem_back::draw(sel, row, plabel, ...)
253
+ *     MenuItem_back::action(flabel, ...)
254
+ *     MenuItem_back::draw(sel, row, flabel, ...)
255
  *
255
  *
256
  *   ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause)
256
  *   ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause)
257
- *     MenuItem_function::action(plabel, lcd_sdcard_pause)
258
- *     MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause)
257
+ *     MenuItem_function::action(flabel, lcd_sdcard_pause)
258
+ *     MenuItem_function::draw(sel, row, flabel, lcd_sdcard_pause)
259
  *
259
  *
260
  *   EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
260
  *   EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
261
- *     MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999)
262
- *     MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999)
261
+ *     MenuItem_int3::action(flabel, &feedrate_percentage, 10, 999)
262
+ *     MenuItem_int3::draw(sel, row, flabel, &feedrate_percentage, 10, 999)
263
  */
263
  */
264
 
264
 
265
 #if ENABLED(ENCODER_RATE_MULTIPLIER)
265
 #if ENABLED(ENCODER_RATE_MULTIPLIER)
268
   #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER)
268
   #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER)
269
 #endif
269
 #endif
270
 
270
 
271
-#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \
272
-  PGM_P const plabel = PLABEL;                                 \
271
+#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \
272
+  FSTR_P const flabel = FLABEL;                                \
273
   if (encoderLine == _thisItemNr && ui.use_click()) {          \
273
   if (encoderLine == _thisItemNr && ui.use_click()) {          \
274
     _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER);               \
274
     _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER);               \
275
-    MenuItem_##TYPE::action(plabel, ##V);                      \
275
+    MenuItem_##TYPE::action(flabel, ##V);                      \
276
     if (ui.screen_changed) return;                             \
276
     if (ui.screen_changed) return;                             \
277
   }                                                            \
277
   }                                                            \
278
   if (ui.should_draw())                                        \
278
   if (ui.should_draw())                                        \
279
     MenuItem_##TYPE::draw                                      \
279
     MenuItem_##TYPE::draw                                      \
280
-      (encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V);   \
280
+      (encoderLine == _thisItemNr, _lcdLineNr, flabel, ##V);   \
281
 }while(0)
281
 }while(0)
282
 
282
 
283
-#define _MENU_ITEM_P(TYPE, V...) do { \
283
+#define _MENU_ITEM_F(TYPE, V...) do { \
284
   if (_menuLineNr == _thisItemNr) {   \
284
   if (_menuLineNr == _thisItemNr) {   \
285
     _skipStatic = false;              \
285
     _skipStatic = false;              \
286
     _MENU_INNER_P(TYPE, ##V);         \
286
     _MENU_INNER_P(TYPE, ##V);         \
289
 }while(0)
289
 }while(0)
290
 
290
 
291
 // Indexed items set a global index value and optional data
291
 // Indexed items set a global index value and optional data
292
-#define _MENU_ITEM_N_S_P(TYPE, N, S, V...) do{ \
292
+#define _MENU_ITEM_N_S_F(TYPE, N, S, V...) do{ \
293
   if (_menuLineNr == _thisItemNr) {            \
293
   if (_menuLineNr == _thisItemNr) {            \
294
     _skipStatic = false;                       \
294
     _skipStatic = false;                       \
295
     MenuItemBase::init(N, S);                  \
295
     MenuItemBase::init(N, S);                  \
299
 }while(0)
299
 }while(0)
300
 
300
 
301
 // Indexed items set a global index value
301
 // Indexed items set a global index value
302
-#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \
302
+#define _MENU_ITEM_N_F(TYPE, N, V...) do{ \
303
   if (_menuLineNr == _thisItemNr) {       \
303
   if (_menuLineNr == _thisItemNr) {       \
304
     _skipStatic = false;                  \
304
     _skipStatic = false;                  \
305
     MenuItemBase::itemIndex = N;          \
305
     MenuItemBase::itemIndex = N;          \
309
 }while(0)
309
 }while(0)
310
 
310
 
311
 // Items with a unique string
311
 // Items with a unique string
312
-#define _MENU_ITEM_S_P(TYPE, S, V...) do{ \
312
+#define _MENU_ITEM_S_F(TYPE, S, V...) do{ \
313
   if (_menuLineNr == _thisItemNr) {       \
313
   if (_menuLineNr == _thisItemNr) {       \
314
     _skipStatic = false;                  \
314
     _skipStatic = false;                  \
315
     MenuItemBase::itemString = S;         \
315
     MenuItemBase::itemString = S;         \
321
 // STATIC_ITEM draws a styled string with no highlight.
321
 // STATIC_ITEM draws a styled string with no highlight.
322
 // Parameters: label [, style [, char *value] ]
322
 // Parameters: label [, style [, char *value] ]
323
 
323
 
324
-#define STATIC_ITEM_INNER_P(PLABEL, V...) do{           \
324
+#define STATIC_ITEM_INNER_F(FLABEL, V...) do{           \
325
   if (_skipStatic && encoderLine <= _thisItemNr) {      \
325
   if (_skipStatic && encoderLine <= _thisItemNr) {      \
326
     ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;  \
326
     ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;  \
327
     ++encoderLine;                                      \
327
     ++encoderLine;                                      \
328
   }                                                     \
328
   }                                                     \
329
   if (ui.should_draw())                                 \
329
   if (ui.should_draw())                                 \
330
-    MenuItem_static::draw(_lcdLineNr, PLABEL, ##V);     \
330
+    MenuItem_static::draw(_lcdLineNr, FLABEL, ##V);     \
331
 } while(0)
331
 } while(0)
332
 
332
 
333
-#define STATIC_ITEM_P(PLABEL, V...) do{ \
333
+#define STATIC_ITEM_F(FLABEL, V...) do{ \
334
   if (_menuLineNr == _thisItemNr)       \
334
   if (_menuLineNr == _thisItemNr)       \
335
-    STATIC_ITEM_INNER_P(PLABEL, ##V);   \
335
+    STATIC_ITEM_INNER_F(FLABEL, ##V);   \
336
   NEXT_ITEM();                          \
336
   NEXT_ITEM();                          \
337
 } while(0)
337
 } while(0)
338
 
338
 
339
-#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \
339
+#define STATIC_ITEM_N_F(FLABEL, N, V...) do{ \
340
   if (_menuLineNr == _thisItemNr) {          \
340
   if (_menuLineNr == _thisItemNr) {          \
341
     MenuItemBase::init(N);                   \
341
     MenuItemBase::init(N);                   \
342
-    STATIC_ITEM_INNER_P(PLABEL, ##V);        \
342
+    STATIC_ITEM_INNER_F(FLABEL, ##V);        \
343
   }                                          \
343
   }                                          \
344
   NEXT_ITEM();                               \
344
   NEXT_ITEM();                               \
345
 }while(0)
345
 }while(0)
347
 // PSTRING_ITEM is like STATIC_ITEM but it takes
347
 // PSTRING_ITEM is like STATIC_ITEM but it takes
348
 // two PSTRs with the style as the last parameter.
348
 // two PSTRs with the style as the last parameter.
349
 
349
 
350
-#define PSTRING_ITEM_P(PLABEL, PVAL, STYL) do{ \
350
+#define PSTRING_ITEM_F(FLABEL, PVAL, STYL) do{ \
351
   constexpr int m = 20;                        \
351
   constexpr int m = 20;                        \
352
   char msg[m+1];                               \
352
   char msg[m+1];                               \
353
   msg[0] = ':'; msg[1] = ' ';                  \
353
   msg[0] = ':'; msg[1] = ' ';                  \
354
   strncpy_P(msg+2, PSTR(PVAL), m-2);           \
354
   strncpy_P(msg+2, PSTR(PVAL), m-2);           \
355
   if (msg[m-1] & 0x80) msg[m-1] = '\0';        \
355
   if (msg[m-1] & 0x80) msg[m-1] = '\0';        \
356
-  STATIC_ITEM_P(PLABEL, STYL, msg);            \
356
+  STATIC_ITEM_F(FLABEL, STYL, msg);            \
357
 }while(0)
357
 }while(0)
358
 
358
 
359
-#define PSTRING_ITEM(LABEL, V...)                     PSTRING_ITEM_P(GET_TEXT(LABEL), ##V)
359
+#define PSTRING_ITEM(LABEL, V...)                     PSTRING_ITEM_F(GET_TEXT_F(LABEL), ##V)
360
 
360
 
361
-#define STATIC_ITEM(LABEL, V...)                       STATIC_ITEM_P(GET_TEXT(LABEL), ##V)
362
-#define STATIC_ITEM_N(LABEL, N, V...)                STATIC_ITEM_N_P(GET_TEXT(LABEL), N, ##V)
361
+#define STATIC_ITEM(LABEL, V...)                       STATIC_ITEM_F(GET_TEXT_F(LABEL), ##V)
362
+#define STATIC_ITEM_N(LABEL, N, V...)                STATIC_ITEM_N_F(GET_TEXT_F(LABEL), N, ##V)
363
 
363
 
364
-#define MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, V...)   _MENU_ITEM_N_S_P(TYPE, N, S, false, PLABEL, ##V)
365
-#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...)       MENU_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V)
366
-#define MENU_ITEM_S_P(TYPE, S, PLABEL, V...)          _MENU_ITEM_S_P(TYPE, S, false, PLABEL, ##V)
367
-#define MENU_ITEM_S(TYPE, S, LABEL, V...)              MENU_ITEM_S_P(TYPE, S, GET_TEXT(LABEL), ##V)
368
-#define MENU_ITEM_N_P(TYPE, N, PLABEL, V...)          _MENU_ITEM_N_P(TYPE, N, false, PLABEL, ##V)
369
-#define MENU_ITEM_N(TYPE, N, LABEL, V...)              MENU_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V)
370
-#define MENU_ITEM_P(TYPE, PLABEL, V...)                 _MENU_ITEM_P(TYPE, false, PLABEL, ##V)
371
-#define MENU_ITEM(TYPE, LABEL, V...)                     MENU_ITEM_P(TYPE, GET_TEXT(LABEL), ##V)
364
+#define MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, V...)   _MENU_ITEM_N_S_F(TYPE, N, S, false, FLABEL, ##V)
365
+#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...)       MENU_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V)
366
+#define MENU_ITEM_S_F(TYPE, S, FLABEL, V...)          _MENU_ITEM_S_F(TYPE, S, false, FLABEL, ##V)
367
+#define MENU_ITEM_S(TYPE, S, LABEL, V...)              MENU_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V)
368
+#define MENU_ITEM_N_F(TYPE, N, FLABEL, V...)          _MENU_ITEM_N_F(TYPE, N, false, FLABEL, ##V)
369
+#define MENU_ITEM_N(TYPE, N, LABEL, V...)              MENU_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V)
370
+#define MENU_ITEM_F(TYPE, FLABEL, V...)                 _MENU_ITEM_F(TYPE, false, FLABEL, ##V)
371
+#define MENU_ITEM(TYPE, LABEL, V...)                     MENU_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V)
372
 
372
 
373
-#define BACK_ITEM_P(PLABEL)                              MENU_ITEM_P(back, PLABEL)
373
+#define BACK_ITEM_F(FLABEL)                              MENU_ITEM_F(back, FLABEL)
374
 #define BACK_ITEM(LABEL)                                   MENU_ITEM(back, LABEL)
374
 #define BACK_ITEM(LABEL)                                   MENU_ITEM(back, LABEL)
375
 
375
 
376
-#define ACTION_ITEM_N_S_P(N, S, PLABEL, ACTION)      MENU_ITEM_N_S_P(function, N, S, PLABEL, ACTION)
377
-#define ACTION_ITEM_N_S(N, S, LABEL, ACTION)       ACTION_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ACTION)
378
-#define ACTION_ITEM_S_P(S, PLABEL, ACTION)             MENU_ITEM_S_P(function, S, PLABEL, ACTION)
379
-#define ACTION_ITEM_S(S, LABEL, ACTION)              ACTION_ITEM_S_P(S, GET_TEXT(LABEL), ACTION)
380
-#define ACTION_ITEM_N_P(N, PLABEL, ACTION)             MENU_ITEM_N_P(function, N, PLABEL, ACTION)
381
-#define ACTION_ITEM_N(N, LABEL, ACTION)              ACTION_ITEM_N_P(N, GET_TEXT(LABEL), ACTION)
382
-#define ACTION_ITEM_P(PLABEL, ACTION)                    MENU_ITEM_P(function, PLABEL, ACTION)
383
-#define ACTION_ITEM(LABEL, ACTION)                     ACTION_ITEM_P(GET_TEXT(LABEL), ACTION)
384
-
385
-#define GCODES_ITEM_N_S_P(N, S, PLABEL, GCODES)      MENU_ITEM_N_S_P(gcode, N, S, PLABEL, GCODES)
386
-#define GCODES_ITEM_N_S(N, S, LABEL, GCODES)       GCODES_ITEM_N_S_P(N, S, GET_TEXT(LABEL), GCODES)
387
-#define GCODES_ITEM_S_P(S, PLABEL, GCODES)             MENU_ITEM_S_P(gcode, S, PLABEL, GCODES)
388
-#define GCODES_ITEM_S(S, LABEL, GCODES)              GCODES_ITEM_S_P(S, GET_TEXT(LABEL), GCODES)
389
-#define GCODES_ITEM_N_P(N, PLABEL, GCODES)             MENU_ITEM_N_P(gcode, N, PLABEL, GCODES)
390
-#define GCODES_ITEM_N(N, LABEL, GCODES)              GCODES_ITEM_N_P(N, GET_TEXT(LABEL), GCODES)
391
-#define GCODES_ITEM_P(PLABEL, GCODES)                    MENU_ITEM_P(gcode, PLABEL, GCODES)
392
-#define GCODES_ITEM(LABEL, GCODES)                     GCODES_ITEM_P(GET_TEXT(LABEL), GCODES)
393
-
394
-#define SUBMENU_N_S_P(N, S, PLABEL, DEST)            MENU_ITEM_N_S_P(submenu, N, S, PLABEL, DEST)
395
-#define SUBMENU_N_S(N, S, LABEL, DEST)                 SUBMENU_N_S_P(N, S, GET_TEXT(LABEL), DEST)
396
-#define SUBMENU_S_P(S, PLABEL, DEST)                   MENU_ITEM_S_P(submenu, S, PLABEL, DEST)
397
-#define SUBMENU_S(S, LABEL, DEST)                        SUBMENU_S_P(S, GET_TEXT(LABEL), DEST)
398
-#define SUBMENU_N_P(N, PLABEL, DEST)                   MENU_ITEM_N_P(submenu, N, PLABEL, DEST)
399
-#define SUBMENU_N(N, LABEL, DEST)                        SUBMENU_N_P(N, GET_TEXT(LABEL), DEST)
400
-#define SUBMENU_P(PLABEL, DEST)                          MENU_ITEM_P(submenu, PLABEL, DEST)
401
-#define SUBMENU(LABEL, DEST)                               SUBMENU_P(GET_TEXT(LABEL), DEST)
402
-
403
-#define EDIT_ITEM_N_S_P(TYPE, N, S, PLABEL, V...)    MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, ##V)
404
-#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...)       EDIT_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V)
405
-#define EDIT_ITEM_S_P(TYPE, S, PLABEL, V...)           MENU_ITEM_S_P(TYPE, S, PLABEL, ##V)
406
-#define EDIT_ITEM_S(TYPE, S, LABEL, V...)              EDIT_ITEM_S_P(TYPE, S, GET_TEXT(LABEL), ##V)
407
-#define EDIT_ITEM_N_P(TYPE, N, PLABEL, V...)           MENU_ITEM_N_P(TYPE, N, PLABEL, ##V)
408
-#define EDIT_ITEM_N(TYPE, N, LABEL, V...)              EDIT_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V)
409
-#define EDIT_ITEM_P(TYPE, PLABEL, V...)                  MENU_ITEM_P(TYPE, PLABEL, ##V)
410
-#define EDIT_ITEM(TYPE, LABEL, V...)                     EDIT_ITEM_P(TYPE, GET_TEXT(LABEL), ##V)
411
-
412
-#define EDIT_ITEM_FAST_N_S_P(TYPE, N, S, PLABEL, V...)  _MENU_ITEM_N_S_P(TYPE, N, S, true, PLABEL, ##V)
413
-#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_P(TYPE, N, S, true, GET_TEXT(LABEL), ##V)
414
-#define EDIT_ITEM_FAST_S_P(TYPE, S, PLABEL, V...)         _MENU_ITEM_S_P(TYPE, S, true, PLABEL, ##V)
415
-#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...)        EDIT_ITEM_FAST_S_P(TYPE, S, GET_TEXT(LABEL), ##V)
416
-#define EDIT_ITEM_FAST_N_P(TYPE, N, PLABEL, V...)         _MENU_ITEM_N_P(TYPE, N, true, PLABEL, ##V)
417
-#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...)        EDIT_ITEM_FAST_N_P(TYPE, N, GET_TEXT(LABEL), ##V)
418
-#define EDIT_ITEM_FAST_P(TYPE, PLABEL, V...)                _MENU_ITEM_P(TYPE, true, PLABEL, ##V)
419
-#define EDIT_ITEM_FAST(TYPE, LABEL, V...)               EDIT_ITEM_FAST_P(TYPE, GET_TEXT(LABEL), ##V)
420
-
421
-#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do {             \
376
+#define ACTION_ITEM_N_S_F(N, S, FLABEL, ACTION)      MENU_ITEM_N_S_F(function, N, S, FLABEL, ACTION)
377
+#define ACTION_ITEM_N_S(N, S, LABEL, ACTION)       ACTION_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ACTION)
378
+#define ACTION_ITEM_S_F(S, FLABEL, ACTION)             MENU_ITEM_S_F(function, S, FLABEL, ACTION)
379
+#define ACTION_ITEM_S(S, LABEL, ACTION)              ACTION_ITEM_S_F(S, GET_TEXT_F(LABEL), ACTION)
380
+#define ACTION_ITEM_N_F(N, FLABEL, ACTION)             MENU_ITEM_N_F(function, N, FLABEL, ACTION)
381
+#define ACTION_ITEM_N(N, LABEL, ACTION)              ACTION_ITEM_N_F(N, GET_TEXT_F(LABEL), ACTION)
382
+#define ACTION_ITEM_F(FLABEL, ACTION)                    MENU_ITEM_F(function, FLABEL, ACTION)
383
+#define ACTION_ITEM(LABEL, ACTION)                     ACTION_ITEM_F(GET_TEXT_F(LABEL), ACTION)
384
+
385
+#define GCODES_ITEM_N_S_F(N, S, FLABEL, GCODES)      MENU_ITEM_N_S_F(gcode, N, S, FLABEL, GCODES)
386
+#define GCODES_ITEM_N_S(N, S, LABEL, GCODES)       GCODES_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), GCODES)
387
+#define GCODES_ITEM_S_F(S, FLABEL, GCODES)             MENU_ITEM_S_F(gcode, S, FLABEL, GCODES)
388
+#define GCODES_ITEM_S(S, LABEL, GCODES)              GCODES_ITEM_S_F(S, GET_TEXT_F(LABEL), GCODES)
389
+#define GCODES_ITEM_N_F(N, FLABEL, GCODES)             MENU_ITEM_N_F(gcode, N, FLABEL, GCODES)
390
+#define GCODES_ITEM_N(N, LABEL, GCODES)              GCODES_ITEM_N_F(N, GET_TEXT_F(LABEL), GCODES)
391
+#define GCODES_ITEM_F(FLABEL, GCODES)                    MENU_ITEM_F(gcode, FLABEL, GCODES)
392
+#define GCODES_ITEM(LABEL, GCODES)                     GCODES_ITEM_F(GET_TEXT_F(LABEL), GCODES)
393
+
394
+#define SUBMENU_N_S_F(N, S, FLABEL, DEST)            MENU_ITEM_N_S_F(submenu, N, S, FLABEL, DEST)
395
+#define SUBMENU_N_S(N, S, LABEL, DEST)                 SUBMENU_N_S_F(N, S, GET_TEXT_F(LABEL), DEST)
396
+#define SUBMENU_S_F(S, FLABEL, DEST)                   MENU_ITEM_S_F(submenu, S, FLABEL, DEST)
397
+#define SUBMENU_S(S, LABEL, DEST)                        SUBMENU_S_F(S, GET_TEXT_F(LABEL), DEST)
398
+#define SUBMENU_N_F(N, FLABEL, DEST)                   MENU_ITEM_N_F(submenu, N, FLABEL, DEST)
399
+#define SUBMENU_N(N, LABEL, DEST)                        SUBMENU_N_F(N, GET_TEXT_F(LABEL), DEST)
400
+#define SUBMENU_F(FLABEL, DEST)                          MENU_ITEM_F(submenu, FLABEL, DEST)
401
+#define SUBMENU(LABEL, DEST)                               SUBMENU_F(GET_TEXT_F(LABEL), DEST)
402
+
403
+#define EDIT_ITEM_N_S_F(TYPE, N, S, FLABEL, V...)    MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, ##V)
404
+#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...)       EDIT_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V)
405
+#define EDIT_ITEM_S_F(TYPE, S, FLABEL, V...)           MENU_ITEM_S_F(TYPE, S, FLABEL, ##V)
406
+#define EDIT_ITEM_S(TYPE, S, LABEL, V...)              EDIT_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V)
407
+#define EDIT_ITEM_N_F(TYPE, N, FLABEL, V...)           MENU_ITEM_N_F(TYPE, N, FLABEL, ##V)
408
+#define EDIT_ITEM_N(TYPE, N, LABEL, V...)              EDIT_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V)
409
+#define EDIT_ITEM_F(TYPE, FLABEL, V...)                  MENU_ITEM_F(TYPE, FLABEL, ##V)
410
+#define EDIT_ITEM(TYPE, LABEL, V...)                     EDIT_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V)
411
+
412
+#define EDIT_ITEM_FAST_N_S_F(TYPE, N, S, FLABEL, V...)  _MENU_ITEM_N_S_F(TYPE, N, S, true, FLABEL, ##V)
413
+#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_F(TYPE, N, S, true, GET_TEXT_F(LABEL), ##V)
414
+#define EDIT_ITEM_FAST_S_F(TYPE, S, FLABEL, V...)         _MENU_ITEM_S_F(TYPE, S, true, FLABEL, ##V)
415
+#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...)        EDIT_ITEM_FAST_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V)
416
+#define EDIT_ITEM_FAST_N_F(TYPE, N, FLABEL, V...)         _MENU_ITEM_N_F(TYPE, N, true, FLABEL, ##V)
417
+#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...)        EDIT_ITEM_FAST_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V)
418
+#define EDIT_ITEM_FAST_F(TYPE, FLABEL, V...)                _MENU_ITEM_F(TYPE, true, FLABEL, ##V)
419
+#define EDIT_ITEM_FAST(TYPE, LABEL, V...)               EDIT_ITEM_FAST_F(TYPE, GET_TEXT_F(LABEL), ##V)
420
+
421
+#define _CONFIRM_ITEM_INNER_F(FLABEL, V...) do {             \
422
   if (encoderLine == _thisItemNr && ui.use_click()) {        \
422
   if (encoderLine == _thisItemNr && ui.use_click()) {        \
423
     ui.push_current_screen();                                \
423
     ui.push_current_screen();                                \
424
     ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \
424
     ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \
425
     return;                                                  \
425
     return;                                                  \
426
   }                                                          \
426
   }                                                          \
427
   if (ui.should_draw()) MenuItem_confirm::draw               \
427
   if (ui.should_draw()) MenuItem_confirm::draw               \
428
-    (encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V);   \
428
+    (encoderLine == _thisItemNr, _lcdLineNr, FLABEL, ##V);   \
429
 }while(0)
429
 }while(0)
430
 
430
 
431
 // Indexed items set a global index value and optional data
431
 // Indexed items set a global index value and optional data
432
-#define _CONFIRM_ITEM_P(PLABEL, V...) do { \
432
+#define _CONFIRM_ITEM_F(FLABEL, V...) do { \
433
   if (_menuLineNr == _thisItemNr) {        \
433
   if (_menuLineNr == _thisItemNr) {        \
434
     _skipStatic = false;                   \
434
     _skipStatic = false;                   \
435
-    _CONFIRM_ITEM_INNER_P(PLABEL, ##V);    \
435
+    _CONFIRM_ITEM_INNER_F(FLABEL, ##V);    \
436
   }                                        \
436
   }                                        \
437
   NEXT_ITEM();                             \
437
   NEXT_ITEM();                             \
438
 }while(0)
438
 }while(0)
439
 
439
 
440
 // Indexed items set a global index value
440
 // Indexed items set a global index value
441
-#define _CONFIRM_ITEM_N_S_P(N, S, V...) do{ \
441
+#define _CONFIRM_ITEM_N_S_F(N, S, V...) do{ \
442
   if (_menuLineNr == _thisItemNr) {         \
442
   if (_menuLineNr == _thisItemNr) {         \
443
     _skipStatic = false;                    \
443
     _skipStatic = false;                    \
444
     MenuItemBase::init(N, S);               \
444
     MenuItemBase::init(N, S);               \
445
-    _CONFIRM_ITEM_INNER_P(TYPE, ##V);       \
445
+    _CONFIRM_ITEM_INNER_F(TYPE, ##V);       \
446
   }                                         \
446
   }                                         \
447
   NEXT_ITEM();                              \
447
   NEXT_ITEM();                              \
448
 }while(0)
448
 }while(0)
449
 
449
 
450
 // Indexed items set a global index value
450
 // Indexed items set a global index value
451
-#define _CONFIRM_ITEM_N_P(N, V...)              _CONFIRM_ITEM_N_S_P(N, nullptr, V)
451
+#define _CONFIRM_ITEM_N_F(N, V...)              _CONFIRM_ITEM_N_S_F(N, nullptr, V)
452
 
452
 
453
-#define CONFIRM_ITEM_P(PLABEL,A,B,V...)         _CONFIRM_ITEM_P(PLABEL, GET_TEXT(A), GET_TEXT(B), ##V)
454
-#define CONFIRM_ITEM(LABEL, V...)                CONFIRM_ITEM_P(GET_TEXT(LABEL), ##V)
453
+#define CONFIRM_ITEM_F(FLABEL,A,B,V...)         _CONFIRM_ITEM_F(FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V)
454
+#define CONFIRM_ITEM(LABEL, V...)                CONFIRM_ITEM_F(GET_TEXT_F(LABEL), ##V)
455
 
455
 
456
-#define YESNO_ITEM_P(PLABEL, V...)               CONFIRM_ITEM_P(PLABEL, MSG_YES, MSG_NO, ##V)
457
-#define YESNO_ITEM(LABEL, V...)                    YESNO_ITEM_P(GET_TEXT(LABEL), ##V)
456
+#define YESNO_ITEM_F(FLABEL, V...)               CONFIRM_ITEM_F(FLABEL, MSG_YES, MSG_NO, ##V)
457
+#define YESNO_ITEM(LABEL, V...)                    YESNO_ITEM_F(GET_TEXT_F(LABEL), ##V)
458
 
458
 
459
-#define CONFIRM_ITEM_N_S_P(N,S,PLABEL,A,B,V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V)
460
-#define CONFIRM_ITEM_N_S(N,S,LABEL,V...)         CONFIRM_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ##V)
461
-#define CONFIRM_ITEM_N_P(N,PLABEL,A,B,V...)       _CONFIRM_ITEM_N_P(N, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V)
462
-#define CONFIRM_ITEM_N(N,LABEL, V...)              CONFIRM_ITEM_N_P(N, GET_TEXT(LABEL), ##V)
459
+#define CONFIRM_ITEM_N_S_F(N,S,FLABEL,A,B,V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V)
460
+#define CONFIRM_ITEM_N_S(N,S,LABEL,V...)         CONFIRM_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V)
461
+#define CONFIRM_ITEM_N_F(N,FLABEL,A,B,V...)       _CONFIRM_ITEM_N_F(N, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V)
462
+#define CONFIRM_ITEM_N(N,LABEL, V...)              CONFIRM_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V)
463
 
463
 
464
-#define YESNO_ITEM_N_S_P(N,S,PLABEL, V...)      _CONFIRM_ITEM_N_S_P(N, S, PLABEL, MSG_YES, MSG_NO, ##V)
465
-#define YESNO_ITEM_N_S(N,S,LABEL, V...)            YESNO_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ##V)
466
-#define YESNO_ITEM_N_P(N,PLABEL, V...)             CONFIRM_ITEM_N_P(N, PLABEL, MSG_YES, MSG_NO, ##V)
467
-#define YESNO_ITEM_N(N,LABEL, V...)                  YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V)
464
+#define YESNO_ITEM_N_S_F(N,S,FLABEL, V...)      _CONFIRM_ITEM_N_S_F(N, S, FLABEL, MSG_YES, MSG_NO, ##V)
465
+#define YESNO_ITEM_N_S(N,S,LABEL, V...)            YESNO_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V)
466
+#define YESNO_ITEM_N_F(N,FLABEL, V...)             CONFIRM_ITEM_N_F(N, FLABEL, MSG_YES, MSG_NO, ##V)
467
+#define YESNO_ITEM_N(N,LABEL, V...)                  YESNO_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V)
468
 
468
 
469
 #if ENABLED(LEVEL_BED_CORNERS)
469
 #if ENABLED(LEVEL_BED_CORNERS)
470
   void _lcd_level_bed_corners();
470
   void _lcd_level_bed_corners();

+ 5
- 5
Marlin/src/lcd/menu/menu_language.cpp Visa fil

41
   START_MENU();
41
   START_MENU();
42
   BACK_ITEM(MSG_MAIN);
42
   BACK_ITEM(MSG_MAIN);
43
 
43
 
44
-  MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE  )::LANGUAGE, []{ set_lcd_language(0); });
45
-  MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_2)::LANGUAGE, []{ set_lcd_language(1); });
44
+  MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(1)), []{ set_lcd_language(0); });
45
+  MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(2)), []{ set_lcd_language(1); });
46
   #if NUM_LANGUAGES > 2
46
   #if NUM_LANGUAGES > 2
47
-    MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_3)::LANGUAGE, []{ set_lcd_language(2); });
47
+    MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(3)), []{ set_lcd_language(2); });
48
     #if NUM_LANGUAGES > 3
48
     #if NUM_LANGUAGES > 3
49
-      MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_4)::LANGUAGE, []{ set_lcd_language(3); });
49
+      MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(4)), []{ set_lcd_language(3); });
50
       #if NUM_LANGUAGES > 4
50
       #if NUM_LANGUAGES > 4
51
-        MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_5)::LANGUAGE, []{ set_lcd_language(4); });
51
+        MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(5)), []{ set_lcd_language(4); });
52
       #endif
52
       #endif
53
     #endif
53
     #endif
54
   #endif
54
   #endif

+ 28
- 28
Marlin/src/lcd/menu/menu_main.cpp Visa fil

124
       #define _DONE_SCRIPT ""
124
       #define _DONE_SCRIPT ""
125
     #endif
125
     #endif
126
     #define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
126
     #define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
127
-    #define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
128
-    #define _CUSTOM_ITEM_MAIN_CONFIRM(N)             \
129
-      SUBMENU_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), []{ \
130
-          MenuItem_confirm::confirm_screen(          \
131
-            GCODE_LAMBDA_MAIN(N), nullptr,           \
132
-            PSTR(MAIN_MENU_ITEM_##N##_DESC "?")      \
133
-          );                                         \
127
+    #define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_F(F(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
128
+    #define _CUSTOM_ITEM_MAIN_CONFIRM(N)          \
129
+      SUBMENU_F(F(MAIN_MENU_ITEM_##N##_DESC), []{ \
130
+          MenuItem_confirm::confirm_screen(       \
131
+            GCODE_LAMBDA_MAIN(N), nullptr,        \
132
+            F(MAIN_MENU_ITEM_##N##_DESC "?")      \
133
+          );                                      \
134
         })
134
         })
135
 
135
 
136
     #define CUSTOM_ITEM_MAIN(N) do{ \
136
     #define CUSTOM_ITEM_MAIN(N) do{ \
247
       if (card_detected) {
247
       if (card_detected) {
248
         if (!card_open) {
248
         if (!card_open) {
249
           #if PIN_EXISTS(SD_DETECT)
249
           #if PIN_EXISTS(SD_DETECT)
250
-            GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));       // M21 Change Media
251
-          #else                                               // - or -
252
-            ACTION_ITEM(MSG_RELEASE_MEDIA, []{                // M22 Release Media
253
-              queue.inject(PSTR("M22"));
250
+            GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21"));        // M21 Change Media
251
+          #else                                             // - or -
252
+            ACTION_ITEM(MSG_RELEASE_MEDIA, []{              // M22 Release Media
253
+              queue.inject(F("M22"));
254
               #if ENABLED(TFT_COLOR_UI)
254
               #if ENABLED(TFT_COLOR_UI)
255
                 // Menu display issue on item removal with multi language selection menu
255
                 // Menu display issue on item removal with multi language selection menu
256
                 if (encoderTopLine > 0) encoderTopLine--;
256
                 if (encoderTopLine > 0) encoderTopLine--;
258
               #endif
258
               #endif
259
             });
259
             });
260
           #endif
260
           #endif
261
-          SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY);        // Media Menu (or Password First)
261
+          SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY);      // Media Menu (or Password First)
262
         }
262
         }
263
       }
263
       }
264
       else {
264
       else {
265
         #if PIN_EXISTS(SD_DETECT)
265
         #if PIN_EXISTS(SD_DETECT)
266
-          ACTION_ITEM(MSG_NO_MEDIA, nullptr);                 // "No Media"
266
+          ACTION_ITEM(MSG_NO_MEDIA, nullptr);               // "No Media"
267
         #else
267
         #else
268
-          GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));         // M21 Attach Media
268
+          GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21"));          // M21 Attach Media
269
         #endif
269
         #endif
270
       }
270
       }
271
     };
271
     };
279
     #if MACHINE_CAN_STOP
279
     #if MACHINE_CAN_STOP
280
       SUBMENU(MSG_STOP_PRINT, []{
280
       SUBMENU(MSG_STOP_PRINT, []{
281
         MenuItem_confirm::select_screen(
281
         MenuItem_confirm::select_screen(
282
-          GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK),
282
+          GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK),
283
           ui.abort_print, nullptr,
283
           ui.abort_print, nullptr,
284
-          GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?")
284
+          GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?")
285
         );
285
         );
286
       });
286
       });
287
     #endif
287
     #endif
342
   #if ENABLED(CUSTOM_MENU_MAIN)
342
   #if ENABLED(CUSTOM_MENU_MAIN)
343
     if (TERN1(CUSTOM_MENU_MAIN_ONLY_IDLE, !busy)) {
343
     if (TERN1(CUSTOM_MENU_MAIN_ONLY_IDLE, !busy)) {
344
       #ifdef CUSTOM_MENU_MAIN_TITLE
344
       #ifdef CUSTOM_MENU_MAIN_TITLE
345
-        SUBMENU_P(PSTR(CUSTOM_MENU_MAIN_TITLE), custom_menus_main);
345
+        SUBMENU_F(F(CUSTOM_MENU_MAIN_TITLE), custom_menus_main);
346
       #else
346
       #else
347
         SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_main);
347
         SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_main);
348
       #endif
348
       #endif
353
     #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
353
     #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
354
       YESNO_ITEM(MSG_FILAMENTCHANGE,
354
       YESNO_ITEM(MSG_FILAMENTCHANGE,
355
         menu_change_filament, nullptr,
355
         menu_change_filament, nullptr,
356
-        GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?")
356
+        GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")
357
       );
357
       );
358
     #else
358
     #else
359
       SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
359
       SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
377
         CONFIRM_ITEM(MSG_SWITCH_PS_OFF,
377
         CONFIRM_ITEM(MSG_SWITCH_PS_OFF,
378
           MSG_YES, MSG_NO,
378
           MSG_YES, MSG_NO,
379
           ui.poweroff, nullptr,
379
           ui.poweroff, nullptr,
380
-          GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?")
380
+          GET_TEXT_F(MSG_SWITCH_PS_OFF), (const char *)nullptr, F("?")
381
         );
381
         );
382
       #else
382
       #else
383
         ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff);
383
         ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff);
384
       #endif
384
       #endif
385
     else
385
     else
386
-      GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80"));
386
+      GCODES_ITEM(MSG_SWITCH_PS_ON, F("M80"));
387
   #endif
387
   #endif
388
 
388
 
389
   #if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP)
389
   #if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP)
398
       ui.return_to_status();
398
       ui.return_to_status();
399
     };
399
     };
400
     #if SERVICE_INTERVAL_1 > 0
400
     #if SERVICE_INTERVAL_1 > 0
401
-      CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1),
401
+      CONFIRM_ITEM_F(F(SERVICE_NAME_1),
402
         MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
402
         MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
403
         []{ _service_reset(1); }, nullptr,
403
         []{ _service_reset(1); }, nullptr,
404
-        GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?")
404
+        GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_1), F("?")
405
       );
405
       );
406
     #endif
406
     #endif
407
     #if SERVICE_INTERVAL_2 > 0
407
     #if SERVICE_INTERVAL_2 > 0
408
-      CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2),
408
+      CONFIRM_ITEM_F(F(SERVICE_NAME_2),
409
         MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
409
         MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
410
         []{ _service_reset(2); }, nullptr,
410
         []{ _service_reset(2); }, nullptr,
411
-        GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?")
411
+        GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_2), F("?")
412
       );
412
       );
413
     #endif
413
     #endif
414
     #if SERVICE_INTERVAL_3 > 0
414
     #if SERVICE_INTERVAL_3 > 0
415
-      CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3),
415
+      CONFIRM_ITEM_F(F(SERVICE_NAME_3),
416
         MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
416
         MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
417
         []{ _service_reset(3); }, nullptr,
417
         []{ _service_reset(3); }, nullptr,
418
-        GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?")
418
+        GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_3), F("?")
419
       );
419
       );
420
     #endif
420
     #endif
421
   #endif
421
   #endif
451
   #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)
451
   #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)
452
     SUBMENU(MSG_HOST_SHUTDOWN, []{
452
     SUBMENU(MSG_HOST_SHUTDOWN, []{
453
       MenuItem_confirm::select_screen(
453
       MenuItem_confirm::select_screen(
454
-        GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BUTTON_CANCEL),
454
+        GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL),
455
         []{ ui.return_to_status(); hostui.shutdown(); }, nullptr,
455
         []{ ui.return_to_status(); hostui.shutdown(); }, nullptr,
456
-        GET_TEXT(MSG_HOST_SHUTDOWN), (const char *)nullptr, PSTR("?")
456
+        GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?")
457
       );
457
       );
458
     });
458
     });
459
   #endif
459
   #endif

+ 13
- 13
Marlin/src/lcd/menu/menu_media.cpp Visa fil

61
 
61
 
62
 class MenuItem_sdfile : public MenuItem_sdbase {
62
 class MenuItem_sdfile : public MenuItem_sdbase {
63
   public:
63
   public:
64
-    static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) {
65
-      MenuItem_sdbase::draw(sel, row, pstr, theCard, false);
64
+    static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) {
65
+      MenuItem_sdbase::draw(sel, row, fstr, theCard, false);
66
     }
66
     }
67
-    static void action(PGM_P const pstr, CardReader &) {
67
+    static void action(FSTR_P const fstr, CardReader &) {
68
       #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
68
       #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
69
         // Save menu state for the selected file
69
         // Save menu state for the selected file
70
         sd_encoder_position = ui.encoderPosition;
70
         sd_encoder_position = ui.encoderPosition;
72
         sd_items = screen_items;
72
         sd_items = screen_items;
73
       #endif
73
       #endif
74
       #if ENABLED(SD_MENU_CONFIRM_START)
74
       #if ENABLED(SD_MENU_CONFIRM_START)
75
-        MenuItem_submenu::action(pstr, []{
75
+        MenuItem_submenu::action(fstr, []{
76
           char * const longest = card.longest_filename();
76
           char * const longest = card.longest_filename();
77
           char buffer[strlen(longest) + 2];
77
           char buffer[strlen(longest) + 2];
78
           buffer[0] = ' ';
78
           buffer[0] = ' ';
79
           strcpy(buffer + 1, longest);
79
           strcpy(buffer + 1, longest);
80
           MenuItem_confirm::select_screen(
80
           MenuItem_confirm::select_screen(
81
-            GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL),
81
+            GET_TEXT_F(MSG_BUTTON_PRINT), GET_TEXT_F(MSG_BUTTON_CANCEL),
82
             sdcard_start_selected_file, nullptr,
82
             sdcard_start_selected_file, nullptr,
83
-            GET_TEXT(MSG_START_PRINT), buffer, PSTR("?")
83
+            GET_TEXT_F(MSG_START_PRINT), buffer, F("?")
84
           );
84
           );
85
         });
85
         });
86
       #else
86
       #else
87
         sdcard_start_selected_file();
87
         sdcard_start_selected_file();
88
-        UNUSED(pstr);
88
+        UNUSED(fstr);
89
       #endif
89
       #endif
90
     }
90
     }
91
 };
91
 };
92
 
92
 
93
 class MenuItem_sdfolder : public MenuItem_sdbase {
93
 class MenuItem_sdfolder : public MenuItem_sdbase {
94
   public:
94
   public:
95
-    static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) {
96
-      MenuItem_sdbase::draw(sel, row, pstr, theCard, true);
95
+    static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) {
96
+      MenuItem_sdbase::draw(sel, row, fstr, theCard, true);
97
     }
97
     }
98
-    static void action(PGM_P const, CardReader &theCard) {
98
+    static void action(FSTR_P const, CardReader &theCard) {
99
       card.cd(theCard.filename);
99
       card.cd(theCard.filename);
100
       encoderTopLine = 0;
100
       encoderTopLine = 0;
101
       ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM);
101
       ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM);
119
   #if ENABLED(MULTI_VOLUME)
119
   #if ENABLED(MULTI_VOLUME)
120
     ACTION_ITEM(MSG_BACK, []{ ui.goto_screen(menu_media); });
120
     ACTION_ITEM(MSG_BACK, []{ ui.goto_screen(menu_media); });
121
   #else
121
   #else
122
-    BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK));
122
+    BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK));
123
   #endif
123
   #endif
124
   if (card.flag.workDirIsRoot) {
124
   if (card.flag.workDirIsRoot) {
125
     #if !PIN_EXISTS(SD_DETECT)
125
     #if !PIN_EXISTS(SD_DETECT)
127
     #endif
127
     #endif
128
   }
128
   }
129
   else if (card.isMounted())
129
   else if (card.isMounted())
130
-    ACTION_ITEM_P(PSTR(LCD_STR_FOLDER " .."), lcd_sd_updir);
130
+    ACTION_ITEM_F(F(LCD_STR_FOLDER " .."), lcd_sd_updir);
131
 
131
 
132
   if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
132
   if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
133
     if (_menuLineNr == _thisItemNr) {
133
     if (_menuLineNr == _thisItemNr) {
146
 #if ENABLED(MULTI_VOLUME)
146
 #if ENABLED(MULTI_VOLUME)
147
   void menu_media_select() {
147
   void menu_media_select() {
148
     START_MENU();
148
     START_MENU();
149
-    BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK));
149
+    BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK));
150
     #if ENABLED(VOLUME_SD_ONBOARD)
150
     #if ENABLED(VOLUME_SD_ONBOARD)
151
       ACTION_ITEM(MSG_SD_CARD, []{ card.changeMedia(&card.media_driver_sdcard); card.mount(); ui.goto_screen(menu_media_filelist); });
151
       ACTION_ITEM(MSG_SD_CARD, []{ card.changeMedia(&card.media_driver_sdcard); card.mount(); ui.goto_screen(menu_media_filelist); });
152
     #endif
152
     #endif

+ 5
- 5
Marlin/src/lcd/menu/menu_mixer.cpp Visa fil

89
 
89
 
90
     char tmp[18];
90
     char tmp[18];
91
 
91
 
92
-    PGM_P const slabel = GET_TEXT(MSG_START_Z);
93
-    SUBMENU_P(slabel, []{ _lcd_mixer_gradient_z_edit(false); });
92
+    FSTR_P const slabel = GET_TEXT_F(MSG_START_Z);
93
+    SUBMENU_F(slabel, []{ _lcd_mixer_gradient_z_edit(false); });
94
     MENU_ITEM_ADDON_START_RJ(11);
94
     MENU_ITEM_ADDON_START_RJ(11);
95
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
95
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
96
       lcd_put_u8str(tmp);
96
       lcd_put_u8str(tmp);
97
     MENU_ITEM_ADDON_END();
97
     MENU_ITEM_ADDON_END();
98
 
98
 
99
-    PGM_P const elabel = GET_TEXT(MSG_END_Z);
100
-    SUBMENU_P(elabel, []{ _lcd_mixer_gradient_z_edit(true); });
99
+    FSTR_P const elabel = GET_TEXT_F(MSG_END_Z);
100
+    SUBMENU_F(elabel, []{ _lcd_mixer_gradient_z_edit(true); });
101
     MENU_ITEM_ADDON_START_RJ(11);
101
     MENU_ITEM_ADDON_START_RJ(11);
102
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
102
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
103
       lcd_put_u8str(tmp);
103
       lcd_put_u8str(tmp);
257
       ui.return_to_status();
257
       ui.return_to_status();
258
     },
258
     },
259
     nullptr,
259
     nullptr,
260
-    GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?")
260
+    GET_TEXT_F(MSG_RESET_VTOOLS), (const char *)nullptr, F("?")
261
   );
261
   );
262
 
262
 
263
   #if ENABLED(GRADIENT_MIX)
263
   #if ENABLED(GRADIENT_MIX)

+ 53
- 53
Marlin/src/lcd/menu/menu_motion.cpp Visa fil

57
 // "Motion" > "Move Axis" submenu
57
 // "Motion" > "Move Axis" submenu
58
 //
58
 //
59
 
59
 
60
-static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
60
+static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) {
61
   if (ui.use_click()) return ui.goto_previous_screen_no_defer();
61
   if (ui.use_click()) return ui.goto_previous_screen_no_defer();
62
   if (ui.encoderPosition && !ui.manual_move.processing) {
62
   if (ui.encoderPosition && !ui.manual_move.processing) {
63
     // Get motion limit from software endstops, if any
63
     // Get motion limit from software endstops, if any
90
       MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
90
       MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
91
   }
91
   }
92
 }
92
 }
93
-void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
93
+void lcd_move_x() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_X), X_AXIS); }
94
 #if HAS_Y_AXIS
94
 #if HAS_Y_AXIS
95
-  void lcd_move_y() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Y), Y_AXIS); }
95
+  void lcd_move_y() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Y), Y_AXIS); }
96
 #endif
96
 #endif
97
 #if HAS_Z_AXIS
97
 #if HAS_Z_AXIS
98
-  void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
98
+  void lcd_move_z() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Z), Z_AXIS); }
99
 #endif
99
 #endif
100
 #if HAS_I_AXIS
100
 #if HAS_I_AXIS
101
-  void lcd_move_i() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_I), I_AXIS); }
101
+  void lcd_move_i() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_I), I_AXIS); }
102
 #endif
102
 #endif
103
 #if HAS_J_AXIS
103
 #if HAS_J_AXIS
104
-  void lcd_move_j() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_J), J_AXIS); }
104
+  void lcd_move_j() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_J), J_AXIS); }
105
 #endif
105
 #endif
106
 #if HAS_K_AXIS
106
 #if HAS_K_AXIS
107
-  void lcd_move_k() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_K), K_AXIS); }
107
+  void lcd_move_k() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_K), K_AXIS); }
108
 #endif
108
 #endif
109
 #if HAS_U_AXIS
109
 #if HAS_U_AXIS
110
-  void lcd_move_u() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_U), U_AXIS); }
110
+  void lcd_move_u() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_U), U_AXIS); }
111
 #endif
111
 #endif
112
 #if HAS_V_AXIS
112
 #if HAS_V_AXIS
113
-  void lcd_move_v() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_V), V_AXIS); }
113
+  void lcd_move_v() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_V), V_AXIS); }
114
 #endif
114
 #endif
115
 #if HAS_W_AXIS
115
 #if HAS_W_AXIS
116
-  void lcd_move_w() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_W), W_AXIS); }
116
+  void lcd_move_w() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_W), W_AXIS); }
117
 #endif
117
 #endif
118
 
118
 
119
 #if E_MANUAL
119
 #if E_MANUAL
132
     if (ui.should_draw()) {
132
     if (ui.should_draw()) {
133
       TERN_(MULTI_E_MANUAL, MenuItemBase::init(eindex));
133
       TERN_(MULTI_E_MANUAL, MenuItemBase::init(eindex));
134
       MenuEditItemBase::draw_edit_screen(
134
       MenuEditItemBase::draw_edit_screen(
135
-        GET_TEXT(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
135
+        GET_TEXT_F(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
136
         ftostr41sign(current_position.e
136
         ftostr41sign(current_position.e
137
           PLUS_TERN0(IS_KINEMATIC, ui.manual_move.offset)
137
           PLUS_TERN0(IS_KINEMATIC, ui.manual_move.offset)
138
           MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
138
           MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
203
       char tmp[strlen_P(label) + 10 + 1], numstr[10];
203
       char tmp[strlen_P(label) + 10 + 1], numstr[10];
204
       sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
204
       sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
205
       #if DISABLED(HAS_GRAPHICAL_TFT)
205
       #if DISABLED(HAS_GRAPHICAL_TFT)
206
-        SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
206
+        SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
207
         MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
207
         MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
208
         lcd_put_u8str(tmp);
208
         lcd_put_u8str(tmp);
209
         MENU_ITEM_ADDON_END();
209
         MENU_ITEM_ADDON_END();
210
       #else
210
       #else
211
-        SUBMENU_P(tmp, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
211
+        SUBMENU_F(FPSTR(tmp), []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
212
       #endif
212
       #endif
213
     }
213
     }
214
   }
214
   }
227
       if (too_cold) {
227
       if (too_cold) {
228
         ui.goto_screen([]{
228
         ui.goto_screen([]{
229
           MenuItem_confirm::select_screen(
229
           MenuItem_confirm::select_screen(
230
-            GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK),
230
+            GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BACK),
231
             _goto_menu_move_distance_e, nullptr,
231
             _goto_menu_move_distance_e, nullptr,
232
-            GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
232
+            GET_TEXT_F(MSG_HOTEND_TOO_COLD), (const char *)nullptr, F("!")
233
           );
233
           );
234
         });
234
         });
235
         return;
235
         return;
283
     #endif
283
     #endif
284
   }
284
   }
285
   else
285
   else
286
-    GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
286
+    GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
287
 
287
 
288
   #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD)
288
   #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD)
289
 
289
 
290
     #if EXTRUDERS >= 4
290
     #if EXTRUDERS >= 4
291
       switch (active_extruder) {
291
       switch (active_extruder) {
292
-        case 0: GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); break;
293
-        case 1: GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); break;
294
-        case 2: GCODES_ITEM_N(3, MSG_SELECT_E, PSTR("T3")); break;
295
-        case 3: GCODES_ITEM_N(2, MSG_SELECT_E, PSTR("T2")); break;
292
+        case 0: GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); break;
293
+        case 1: GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); break;
294
+        case 2: GCODES_ITEM_N(3, MSG_SELECT_E, F("T3")); break;
295
+        case 3: GCODES_ITEM_N(2, MSG_SELECT_E, F("T2")); break;
296
         #if EXTRUDERS == 6
296
         #if EXTRUDERS == 6
297
-          case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break;
298
-          case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break;
297
+          case 4: GCODES_ITEM_N(5, MSG_SELECT_E, F("T5")); break;
298
+          case 5: GCODES_ITEM_N(4, MSG_SELECT_E, F("T4")); break;
299
         #endif
299
         #endif
300
       }
300
       }
301
     #elif EXTRUDERS == 3
301
     #elif EXTRUDERS == 3
302
       if (active_extruder < 2) {
302
       if (active_extruder < 2) {
303
         if (active_extruder)
303
         if (active_extruder)
304
-          GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
304
+          GCODES_ITEM_N(0, MSG_SELECT_E, F("T0"));
305
         else
305
         else
306
-          GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
306
+          GCODES_ITEM_N(1, MSG_SELECT_E, F("T1"));
307
       }
307
       }
308
     #else
308
     #else
309
       if (active_extruder)
309
       if (active_extruder)
310
-        GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
310
+        GCODES_ITEM_N(0, MSG_SELECT_E, F("T0"));
311
       else
311
       else
312
-        GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
312
+        GCODES_ITEM_N(1, MSG_SELECT_E, F("T1"));
313
     #endif
313
     #endif
314
 
314
 
315
   #elif ENABLED(DUAL_X_CARRIAGE)
315
   #elif ENABLED(DUAL_X_CARRIAGE)
316
 
316
 
317
     if (active_extruder)
317
     if (active_extruder)
318
-      GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
318
+      GCODES_ITEM_N(0, MSG_SELECT_E, F("T0"));
319
     else
319
     else
320
-      GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
320
+      GCODES_ITEM_N(1, MSG_SELECT_E, F("T1"));
321
 
321
 
322
   #endif
322
   #endif
323
 
323
 
355
     START_MENU();
355
     START_MENU();
356
     BACK_ITEM(MSG_MOTION);
356
     BACK_ITEM(MSG_MOTION);
357
 
357
 
358
-    GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
359
-    GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, PSTR("G28X"));
358
+    GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
359
+    GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X"));
360
     #if HAS_Y_AXIS
360
     #if HAS_Y_AXIS
361
-      GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, PSTR("G28Y"));
361
+      GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y"));
362
     #endif
362
     #endif
363
     #if HAS_Z_AXIS
363
     #if HAS_Z_AXIS
364
-      GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z"));
364
+      GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z"));
365
     #endif
365
     #endif
366
     #if HAS_I_AXIS
366
     #if HAS_I_AXIS
367
-      GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_I));
367
+      GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I));
368
     #endif
368
     #endif
369
     #if HAS_J_AXIS
369
     #if HAS_J_AXIS
370
-      GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_J));
370
+      GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J));
371
     #endif
371
     #endif
372
     #if HAS_K_AXIS
372
     #if HAS_K_AXIS
373
-      GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_K));
373
+      GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K));
374
     #endif
374
     #endif
375
     #if HAS_U_AXIS
375
     #if HAS_U_AXIS
376
-      GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_U));
376
+      GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, F("G28" STR_U));
377
     #endif
377
     #endif
378
     #if HAS_V_AXIS
378
     #if HAS_V_AXIS
379
-      GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_V));
379
+      GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, F("G28" STR_V));
380
     #endif
380
     #endif
381
     #if HAS_W_AXIS
381
     #if HAS_W_AXIS
382
-      GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_W));
382
+      GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, F("G28" STR_W));
383
     #endif
383
     #endif
384
 
384
 
385
     END_MENU();
385
     END_MENU();
416
   #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
416
   #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
417
     SUBMENU(MSG_HOMING, menu_home);
417
     SUBMENU(MSG_HOMING, menu_home);
418
   #else
418
   #else
419
-    GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
419
+    GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
420
     #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
420
     #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
421
-      GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, PSTR("G28X"));
421
+      GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X"));
422
       #if HAS_Y_AXIS
422
       #if HAS_Y_AXIS
423
-        GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, PSTR("G28Y"));
423
+        GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y"));
424
       #endif
424
       #endif
425
       #if HAS_Z_AXIS
425
       #if HAS_Z_AXIS
426
-        GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z"));
426
+        GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z"));
427
       #endif
427
       #endif
428
       #if HAS_I_AXIS
428
       #if HAS_I_AXIS
429
-        GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_I));
429
+        GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I));
430
       #endif
430
       #endif
431
       #if HAS_J_AXIS
431
       #if HAS_J_AXIS
432
-        GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_J));
432
+        GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J));
433
       #endif
433
       #endif
434
       #if HAS_K_AXIS
434
       #if HAS_K_AXIS
435
-        GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_K));
435
+        GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K));
436
       #endif
436
       #endif
437
       #if HAS_U_AXIS
437
       #if HAS_U_AXIS
438
-        GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_U));
438
+        GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, F("G28" STR_U));
439
       #endif
439
       #endif
440
       #if HAS_V_AXIS
440
       #if HAS_V_AXIS
441
-        GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_V));
441
+        GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, F("G28" STR_V));
442
       #endif
442
       #endif
443
       #if HAS_W_AXIS
443
       #if HAS_W_AXIS
444
-        GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_W));
444
+        GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, F("G28" STR_W));
445
       #endif
445
       #endif
446
     #endif
446
     #endif
447
   #endif
447
   #endif
450
   // Auto-calibration
450
   // Auto-calibration
451
   //
451
   //
452
   #if ENABLED(CALIBRATION_GCODE)
452
   #if ENABLED(CALIBRATION_GCODE)
453
-    GCODES_ITEM(MSG_AUTO_CALIBRATE, PSTR("G425"));
453
+    GCODES_ITEM(MSG_AUTO_CALIBRATE, F("G425"));
454
   #endif
454
   #endif
455
 
455
 
456
   //
456
   //
457
   // Auto Z-Align
457
   // Auto Z-Align
458
   //
458
   //
459
   #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
459
   #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
460
-    GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34"));
460
+    GCODES_ITEM(MSG_AUTO_Z_ALIGN, F("G34"));
461
   #endif
461
   #endif
462
 
462
 
463
   //
463
   //
482
   #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)
482
   #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)
483
 
483
 
484
     #if DISABLED(PROBE_MANUALLY)
484
     #if DISABLED(PROBE_MANUALLY)
485
-      GCODES_ITEM(MSG_LEVEL_BED, PSTR("G29N"));
485
+      GCODES_ITEM(MSG_LEVEL_BED, F("G29N"));
486
     #endif
486
     #endif
487
 
487
 
488
     if (all_axes_homed() && leveling_is_valid()) {
488
     if (all_axes_homed() && leveling_is_valid()) {
502
   #endif
502
   #endif
503
 
503
 
504
   #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
504
   #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
505
-    GCODES_ITEM(MSG_M48_TEST, PSTR("G28O\nM48 P10"));
505
+    GCODES_ITEM(MSG_M48_TEST, F("G28O\nM48 P10"));
506
   #endif
506
   #endif
507
 
507
 
508
   //
508
   //
509
   // Disable Steppers
509
   // Disable Steppers
510
   //
510
   //
511
-  GCODES_ITEM(MSG_DISABLE_STEPPERS, PSTR("M84"));
511
+  GCODES_ITEM(MSG_DISABLE_STEPPERS, F("M84"));
512
 
512
 
513
   END_MENU();
513
   END_MENU();
514
 }
514
 }

+ 6
- 6
Marlin/src/lcd/menu/menu_password.cpp Visa fil

49
   START_MENU();
49
   START_MENU();
50
 
50
 
51
   // "Login" or "New Code"
51
   // "Login" or "New Code"
52
-  STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
52
+  STATIC_ITEM_F(authenticating ? GET_TEXT_F(MSG_LOGIN_REQUIRED) : GET_TEXT_F(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
53
 
53
 
54
-  STATIC_ITEM_P(NUL_STR, SS_CENTER, string);
54
+  STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, string);
55
 
55
 
56
   #if HAS_MARLINUI_U8GLIB
56
   #if HAS_MARLINUI_U8GLIB
57
-    STATIC_ITEM_P(NUL_STR, SS_CENTER, "");
57
+    STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, "");
58
   #endif
58
   #endif
59
 
59
 
60
   // Make the digit edit item look like a sub-menu
60
   // Make the digit edit item look like a sub-menu
61
-  PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT);
62
-  EDIT_ITEM_P(uint8, label, &editable.uint8, 0, 9, digit_entered);
63
-  MENU_ITEM_ADDON_START(utf8_strlen_P(label) + 1);
61
+  FSTR_P const label = GET_TEXT_F(MSG_ENTER_DIGIT);
62
+  EDIT_ITEM_F(uint8, label, &editable.uint8, 0, 9, digit_entered);
63
+  MENU_ITEM_ADDON_START(utf8_strlen(label) + 1);
64
     lcd_put_wchar(' ');
64
     lcd_put_wchar(' ');
65
     lcd_put_wchar('1' + digit_no);
65
     lcd_put_wchar('1' + digit_no);
66
     SETCURSOR_X(LCD_WIDTH - 2);
66
     SETCURSOR_X(LCD_WIDTH - 2);

+ 5
- 5
Marlin/src/lcd/menu/menu_probe_offset.cpp Visa fil

62
   if (LCD_HEIGHT >= 4)
62
   if (LCD_HEIGHT >= 4)
63
     STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
63
     STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
64
 
64
 
65
-  STATIC_ITEM_P(PSTR("Z"), SS_CENTER, ftostr42_52(current_position.z));
65
+  STATIC_ITEM_F(F("Z"), SS_CENTER, ftostr42_52(current_position.z));
66
   STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
66
   STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
67
 
67
 
68
   SUBMENU(MSG_MOVE_1MM,  []{ _goto_manual_move_z( 1);    });
68
   SUBMENU(MSG_MOVE_1MM,  []{ _goto_manual_move_z( 1);    });
75
                          !UNEAR_ZERO((FINE_MANUAL_MOVE) *  100 - int((FINE_MANUAL_MOVE) *  100)) ? 3 : 2;
75
                          !UNEAR_ZERO((FINE_MANUAL_MOVE) *  100 - int((FINE_MANUAL_MOVE) *  100)) ? 3 : 2;
76
     sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
76
     sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
77
     #if DISABLED(HAS_GRAPHICAL_TFT)
77
     #if DISABLED(HAS_GRAPHICAL_TFT)
78
-      SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
78
+      SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
79
       MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
79
       MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
80
       lcd_put_u8str(tmp);
80
       lcd_put_u8str(tmp);
81
       MENU_ITEM_ADDON_END();
81
       MENU_ITEM_ADDON_END();
82
     #else
82
     #else
83
-      SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
83
+      SUBMENU_F(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
84
     #endif
84
     #endif
85
   }
85
   }
86
 
86
 
107
 
107
 
108
 void prepare_for_probe_offset_wizard() {
108
 void prepare_for_probe_offset_wizard() {
109
   #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE
109
   #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE
110
-    if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING));
110
+    if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT_F(MSG_PROBE_WIZARD_PROBING));
111
 
111
 
112
     if (ui.wait_for_move) return;
112
     if (ui.wait_for_move) return;
113
 
113
 
133
   ui.wait_for_move = true;
133
   ui.wait_for_move = true;
134
   current_position += probe.offset_xy;
134
   current_position += probe.offset_xy;
135
   line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE));
135
   line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE));
136
-  ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING));
136
+  ui.synchronize(GET_TEXT_F(MSG_PROBE_WIZARD_MOVING));
137
   ui.wait_for_move = false;
137
   ui.wait_for_move = false;
138
 
138
 
139
   SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement
139
   SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement

+ 1
- 1
Marlin/src/lcd/menu/menu_spindle_laser.cpp Visa fil

64
     #if ENABLED(SPINDLE_CHANGE_DIR)
64
     #if ENABLED(SPINDLE_CHANGE_DIR)
65
       if (!is_enabled) {
65
       if (!is_enabled) {
66
         editable.state = is_rev;
66
         editable.state = is_rev;
67
-        ACTION_ITEM_P(is_rev ? GET_TEXT(MSG_CUTTER(REVERSE)) : GET_TEXT(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); });
67
+        ACTION_ITEM_F(is_rev ? GET_TEXT_F(MSG_CUTTER(REVERSE)) : GET_TEXT_F(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); });
68
       }
68
       }
69
     #endif
69
     #endif
70
 
70
 

+ 4
- 4
Marlin/src/lcd/menu/menu_tmc.cpp Visa fil

32
 #include "../../module/stepper/indirection.h"
32
 #include "../../module/stepper/indirection.h"
33
 #include "../../feature/tmc_util.h"
33
 #include "../../feature/tmc_util.h"
34
 
34
 
35
-#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_P(uint16_4, PSTR(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); })
35
+#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_F(uint16_4, F(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); })
36
 
36
 
37
 void menu_tmc_current() {
37
 void menu_tmc_current() {
38
   START_MENU();
38
   START_MENU();
90
 
90
 
91
 #if ENABLED(HYBRID_THRESHOLD)
91
 #if ENABLED(HYBRID_THRESHOLD)
92
 
92
 
93
-  #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_P(uint8, PSTR(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); });
93
+  #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint8, F(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); });
94
 
94
 
95
   void menu_tmc_hybrid_thrs() {
95
   void menu_tmc_hybrid_thrs() {
96
     START_MENU();
96
     START_MENU();
118
 
118
 
119
 #if ENABLED(SENSORLESS_HOMING)
119
 #if ENABLED(SENSORLESS_HOMING)
120
 
120
 
121
-  #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); });
121
+  #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_F(int4, F(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); });
122
 
122
 
123
   void menu_tmc_homing_thrs() {
123
   void menu_tmc_homing_thrs() {
124
     START_MENU();
124
     START_MENU();
144
 
144
 
145
 #if HAS_STEALTHCHOP
145
 #if HAS_STEALTHCHOP
146
 
146
 
147
-  #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_P(bool, PSTR(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); })
147
+  #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_F(bool, F(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); })
148
 
148
 
149
   void menu_tmc_step_mode() {
149
   void menu_tmc_step_mode() {
150
     START_MENU();
150
     START_MENU();

+ 1
- 1
Marlin/src/lcd/menu/menu_tramming.cpp Visa fil

83
 
83
 
84
   // Draw a menu item for each tramming point
84
   // Draw a menu item for each tramming point
85
   for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++)
85
   for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++)
86
-    SUBMENU_P((PGM_P)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
86
+    SUBMENU_F(FPSTR(pgm_read_ptr(&tramming_point_name[tram_index])), _menu_single_probe);
87
 
87
 
88
   ACTION_ITEM(MSG_BUTTON_DONE, []{
88
   ACTION_ITEM(MSG_BUTTON_DONE, []{
89
     probe.stow(); // Stow before exiting Tramming Wizard
89
     probe.stow(); // Stow before exiting Tramming Wizard

+ 5
- 5
Marlin/src/lcd/menu/menu_tune.cpp Visa fil

50
     #include "../dogm/marlinui_DOGM.h"
50
     #include "../dogm/marlinui_DOGM.h"
51
   #endif
51
   #endif
52
 
52
 
53
-  void _lcd_babystep(const AxisEnum axis, PGM_P const msg) {
53
+  void _lcd_babystep(const AxisEnum axis, FSTR_P const fmsg) {
54
     if (ui.use_click()) return ui.goto_previous_screen_no_defer();
54
     if (ui.use_click()) return ui.goto_previous_screen_no_defer();
55
     if (ui.encoderPosition) {
55
     if (ui.encoderPosition) {
56
       const int16_t steps = int16_t(ui.encoderPosition) * (
56
       const int16_t steps = int16_t(ui.encoderPosition) * (
66
     }
66
     }
67
     if (ui.should_draw()) {
67
     if (ui.should_draw()) {
68
       const float mps = planner.mm_per_step[axis];
68
       const float mps = planner.mm_per_step[axis];
69
-      MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(mps * babystep.accum));
69
+      MenuEditItemBase::draw_edit_screen(fmsg, BABYSTEP_TO_STR(mps * babystep.accum));
70
       #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
70
       #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
71
         const bool in_view = TERN1(HAS_MARLINUI_U8GLIB, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1));
71
         const bool in_view = TERN1(HAS_MARLINUI_U8GLIB, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1));
72
         if (in_view) {
72
         if (in_view) {
94
   }
94
   }
95
 
95
 
96
   #if ENABLED(BABYSTEP_XY)
96
   #if ENABLED(BABYSTEP_XY)
97
-    void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT(MSG_BABYSTEP_X)); }
98
-    void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT(MSG_BABYSTEP_Y)); }
97
+    void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT_F(MSG_BABYSTEP_X)); }
98
+    void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT_F(MSG_BABYSTEP_Y)); }
99
   #endif
99
   #endif
100
 
100
 
101
   #if DISABLED(BABYSTEP_ZPROBE_OFFSET)
101
   #if DISABLED(BABYSTEP_ZPROBE_OFFSET)
102
-    void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT(MSG_BABYSTEP_Z)); }
102
+    void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT_F(MSG_BABYSTEP_Z)); }
103
     void lcd_babystep_z()  { _lcd_babystep_go(_lcd_babystep_z); }
103
     void lcd_babystep_z()  { _lcd_babystep_go(_lcd_babystep_z); }
104
   #endif
104
   #endif
105
 
105
 

+ 29
- 29
Marlin/src/lcd/menu/menu_ubl.cpp Visa fil

67
  * - Draw the graphical overlay, if enabled.
67
  * - Draw the graphical overlay, if enabled.
68
  * - Update the 'refresh' state according to the display type
68
  * - Update the 'refresh' state according to the display type
69
  */
69
  */
70
-void _lcd_mesh_fine_tune(PGM_P const msg) {
70
+void _lcd_mesh_fine_tune(FSTR_P const fmsg) {
71
   constexpr float mesh_edit_step = 1.0f / 200.0f;
71
   constexpr float mesh_edit_step = 1.0f / 200.0f;
72
   ui.defer_status_screen();
72
   ui.defer_status_screen();
73
   if (bedlevel.encoder_diff) {
73
   if (bedlevel.encoder_diff) {
82
 
82
 
83
   if (ui.should_draw()) {
83
   if (ui.should_draw()) {
84
     const float rounded_f = rounded_mesh_value();
84
     const float rounded_f = rounded_mesh_value();
85
-    MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f));
85
+    MenuEditItemBase::draw_edit_screen(fmsg, ftostr43sign(rounded_f));
86
     TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f));
86
     TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f));
87
     TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE));
87
     TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE));
88
   }
88
   }
95
 void MarlinUI::ubl_mesh_edit_start(const_float_t initial) {
95
 void MarlinUI::ubl_mesh_edit_start(const_float_t initial) {
96
   TERN_(HAS_GRAPHICAL_TFT, clear_lcd());
96
   TERN_(HAS_GRAPHICAL_TFT, clear_lcd());
97
   mesh_edit_accumulator = initial;
97
   mesh_edit_accumulator = initial;
98
-  goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDIT_Z)); });
98
+  goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT_F(MSG_MESH_EDIT_Z)); });
99
 }
99
 }
100
 
100
 
101
 //
101
 //
176
 void _lcd_ubl_edit_mesh() {
176
 void _lcd_ubl_edit_mesh() {
177
   START_MENU();
177
   START_MENU();
178
   BACK_ITEM(MSG_UBL_TOOLS);
178
   BACK_ITEM(MSG_UBL_TOOLS);
179
-  GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29P4RT"));
180
-  GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29P4T"));
179
+  GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, F("G29P4RT"));
180
+  GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, F("G29P4T"));
181
   SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust);
181
   SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust);
182
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
182
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
183
   END_MENU();
183
   END_MENU();
211
     #if HAS_PREHEAT
211
     #if HAS_PREHEAT
212
       #if HAS_HEATED_BED
212
       #if HAS_HEATED_BED
213
         #define VALIDATE_MESH_GCODE_ITEM(M) \
213
         #define VALIDATE_MESH_GCODE_ITEM(M) \
214
-          GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M)));
214
+          GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPI" STRINGIFY(M)));
215
       #else
215
       #else
216
         #define VALIDATE_MESH_GCODE_ITEM(M) \
216
         #define VALIDATE_MESH_GCODE_ITEM(M) \
217
-          GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M)));
217
+          GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPB0I" STRINGIFY(M)));
218
       #endif
218
       #endif
219
       REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM)
219
       REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM)
220
     #endif
220
     #endif
255
 void _lcd_ubl_mesh_leveling() {
255
 void _lcd_ubl_mesh_leveling() {
256
   START_MENU();
256
   START_MENU();
257
   BACK_ITEM(MSG_UBL_TOOLS);
257
   BACK_ITEM(MSG_UBL_TOOLS);
258
-  GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29J0"));
258
+  GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, F("G29J0"));
259
   SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level);
259
   SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level);
260
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
260
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
261
   END_MENU();
261
   END_MENU();
284
   START_MENU();
284
   START_MENU();
285
   BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
285
   BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
286
   EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd);
286
   EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd);
287
-  GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29P3T0"));
288
-  GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29P2BT0"));
287
+  GCODES_ITEM(MSG_UBL_SMART_FILLIN, F("G29P3T0"));
288
+  GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, F("G29P2BT0"));
289
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
289
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
290
   END_MENU();
290
   END_MENU();
291
 }
291
 }
318
       #define PREHEAT_BED_GCODE(M) ""
318
       #define PREHEAT_BED_GCODE(M) ""
319
     #endif
319
     #endif
320
     #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_S(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \
320
     #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_S(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \
321
-      PSTR( \
321
+      F( \
322
         "G28\n" \
322
         "G28\n" \
323
         PREHEAT_BED_GCODE(M) \
323
         PREHEAT_BED_GCODE(M) \
324
         "M109I" STRINGIFY(M) "\n" \
324
         "M109I" STRINGIFY(M) "\n" \
342
   #endif // HAS_PREHEAT
342
   #endif // HAS_PREHEAT
343
 
343
 
344
   SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh);
344
   SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh);
345
-  GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G29NP1"));
345
+  GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, F("G29NP1"));
346
   SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin);
346
   SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin);
347
-  GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29P1C"));
347
+  GCODES_ITEM(MSG_UBL_CONTINUE_MESH, F("G29P1C"));
348
   ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate);
348
   ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate);
349
-  GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29I"));
349
+  GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, F("G29I"));
350
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
350
   ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
351
   END_MENU();
351
   END_MENU();
352
 }
352
 }
354
 /**
354
 /**
355
  * UBL Load / Save Mesh Commands
355
  * UBL Load / Save Mesh Commands
356
  */
356
  */
357
-inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) {
357
+inline void _lcd_ubl_load_save_cmd(const char loadsave, FSTR_P const fmsg) {
358
   char ubl_lcd_gcode[40];
358
   char ubl_lcd_gcode[40];
359
   sprintf_P(ubl_lcd_gcode, PSTR("G29%c%i\nM117 "), loadsave, ubl_storage_slot);
359
   sprintf_P(ubl_lcd_gcode, PSTR("G29%c%i\nM117 "), loadsave, ubl_storage_slot);
360
-  sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot);
360
+  sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], FTOP(fmsg), ubl_storage_slot);
361
   gcode.process_subcommands_now(ubl_lcd_gcode);
361
   gcode.process_subcommands_now(ubl_lcd_gcode);
362
 }
362
 }
363
-void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT(MSG_MESH_LOADED)); }
364
-void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT(MSG_MESH_SAVED)); }
363
+void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT_F(MSG_MESH_LOADED)); }
364
+void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT_F(MSG_MESH_SAVED)); }
365
 
365
 
366
 /**
366
 /**
367
  * UBL Mesh Storage submenu
367
  * UBL Mesh Storage submenu
531
 void _lcd_ubl_output_map() {
531
 void _lcd_ubl_output_map() {
532
   START_MENU();
532
   START_MENU();
533
   BACK_ITEM(MSG_UBL_LEVEL_BED);
533
   BACK_ITEM(MSG_UBL_LEVEL_BED);
534
-  GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29T0"));
535
-  GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29T1"));
536
-  GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29S-1"));
534
+  GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, F("G29T0"));
535
+  GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, F("G29T1"));
536
+  GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, F("G29S-1"));
537
   END_MENU();
537
   END_MENU();
538
 }
538
 }
539
 
539
 
550
   START_MENU();
550
   START_MENU();
551
   BACK_ITEM(MSG_UBL_LEVEL_BED);
551
   BACK_ITEM(MSG_UBL_LEVEL_BED);
552
   SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh);
552
   SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh);
553
-  GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29I999\nG29P2BT0"));
553
+  GCODES_ITEM(MSG_UBL_MANUAL_MESH, F("G29I999\nG29P2BT0"));
554
   #if ENABLED(G26_MESH_VALIDATION)
554
   #if ENABLED(G26_MESH_VALIDATION)
555
     SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
555
     SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
556
   #endif
556
   #endif
576
   void _lcd_ubl_step_by_step() {
576
   void _lcd_ubl_step_by_step() {
577
     START_MENU();
577
     START_MENU();
578
     BACK_ITEM(MSG_UBL_LEVEL_BED);
578
     BACK_ITEM(MSG_UBL_LEVEL_BED);
579
-    GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G29NP1"));
580
-    GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29P3T0"));
579
+    GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, F("G29NP1"));
580
+    GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, F("G29P3T0"));
581
     SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
581
     SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
582
-    GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29P4RT"));
582
+    GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, F("G29P4RT"));
583
     SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
583
     SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
584
-    GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29P4RT"));
584
+    GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, F("G29P4RT"));
585
     ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd);
585
     ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd);
586
     END_MENU();
586
     END_MENU();
587
   }
587
   }
650
   START_MENU();
650
   START_MENU();
651
   BACK_ITEM(MSG_MOTION);
651
   BACK_ITEM(MSG_MOTION);
652
   if (planner.leveling_active)
652
   if (planner.leveling_active)
653
-    GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29D"));
653
+    GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, F("G29D"));
654
   else
654
   else
655
-    GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29A"));
655
+    GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, F("G29A"));
656
   #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
656
   #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
657
     editable.decimal = planner.z_fade_height;
657
     editable.decimal = planner.z_fade_height;
658
     EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); });
658
     EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); });
667
   SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh);
667
   SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh);
668
   SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map);
668
   SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map);
669
   SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools);
669
   SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools);
670
-  GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29W"));
670
+  GCODES_ITEM(MSG_UBL_INFO_UBL, F("G29W"));
671
   END_MENU();
671
   END_MENU();
672
 }
672
 }
673
 
673
 

+ 9
- 9
Marlin/src/lcd/menu/menu_x_twist.cpp Visa fil

51
     ui.goto_screen(menu_advanced_settings);
51
     ui.goto_screen(menu_advanced_settings);
52
   }
52
   }
53
   if (ui.should_draw())
53
   if (ui.should_draw())
54
-    MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_XATC_DONE));
54
+    MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_XATC_DONE));
55
   ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
55
   ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
56
 }
56
 }
57
 
57
 
62
 //
62
 //
63
 void xatc_wizard_update_z_offset() {
63
 void xatc_wizard_update_z_offset() {
64
   MenuItem_confirm::select_screen(
64
   MenuItem_confirm::select_screen(
65
-      GET_TEXT(MSG_YES), GET_TEXT(MSG_NO)
65
+      GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO)
66
     , []{
66
     , []{
67
         probe.offset.z = z_offset;
67
         probe.offset.z = z_offset;
68
         ui.goto_screen(xatc_wizard_done);
68
         ui.goto_screen(xatc_wizard_done);
69
       }
69
       }
70
     , xatc_wizard_done
70
     , xatc_wizard_done
71
-    , GET_TEXT(MSG_XATC_UPDATE_Z_OFFSET)
72
-    , ftostr42_52(z_offset), PSTR("?")
71
+    , GET_TEXT_F(MSG_XATC_UPDATE_Z_OFFSET)
72
+    , ftostr42_52(z_offset), F("?")
73
   );
73
   );
74
 }
74
 }
75
 
75
 
93
   if (LCD_HEIGHT >= 4)
93
   if (LCD_HEIGHT >= 4)
94
     STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
94
     STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
95
 
95
 
96
-  STATIC_ITEM_P(PSTR("Z="), SS_CENTER, ftostr42_52(current_position.z));
96
+  STATIC_ITEM_F(F("Z="), SS_CENTER, ftostr42_52(current_position.z));
97
   STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
97
   STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
98
 
98
 
99
   SUBMENU(MSG_MOVE_1MM,  []{ _goto_manual_move_z( 1);    });
99
   SUBMENU(MSG_MOVE_1MM,  []{ _goto_manual_move_z( 1);    });
106
                          !UNEAR_ZERO((FINE_MANUAL_MOVE) *  100 - int((FINE_MANUAL_MOVE) *  100)) ? 3 : 2;
106
                          !UNEAR_ZERO((FINE_MANUAL_MOVE) *  100 - int((FINE_MANUAL_MOVE) *  100)) ? 3 : 2;
107
     sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
107
     sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
108
     #if DISABLED(HAS_GRAPHICAL_TFT)
108
     #if DISABLED(HAS_GRAPHICAL_TFT)
109
-      SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
109
+      SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
110
       MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
110
       MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
111
       lcd_put_u8str(tmp);
111
       lcd_put_u8str(tmp);
112
       MENU_ITEM_ADDON_END();
112
       MENU_ITEM_ADDON_END();
113
     #else
113
     #else
114
-      SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
114
+      SUBMENU_F(FPSTR(tmp), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
115
     #endif
115
     #endif
116
   }
116
   }
117
 
117
 
127
   if (ui.should_draw()) {
127
   if (ui.should_draw()) {
128
     char msg[10];
128
     char msg[10];
129
     sprintf_P(msg, PSTR("%i / %u"), manual_probe_index + 1, XATC_MAX_POINTS);
129
     sprintf_P(msg, PSTR("%i / %u"), manual_probe_index + 1, XATC_MAX_POINTS);
130
-    MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
130
+    MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg);
131
   }
131
   }
132
   ui.refresh(LCDVIEW_CALL_NO_REDRAW);
132
   ui.refresh(LCDVIEW_CALL_NO_REDRAW);
133
   if (!ui.wait_for_move) ui.goto_screen(xatc_wizard_menu);
133
   if (!ui.wait_for_move) ui.goto_screen(xatc_wizard_menu);
180
 //
180
 //
181
 void xatc_wizard_homing_done() {
181
 void xatc_wizard_homing_done() {
182
   if (ui.should_draw()) {
182
   if (ui.should_draw()) {
183
-    MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING));
183
+    MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING));
184
 
184
 
185
     // Color UI needs a control to detect a touch
185
     // Color UI needs a control to detect a touch
186
     #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
186
     #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)

+ 4
- 4
Marlin/src/lcd/tft/tft_string.cpp Visa fil

89
 /**
89
 /**
90
  * Add a string, applying substitutions for the following characters:
90
  * Add a string, applying substitutions for the following characters:
91
  *
91
  *
92
- *   $ displays an inserted C-string given by the itemString parameter
92
+ *   $ displays an inserted C-string given by the inStr parameter
93
  *   = displays  '0'....'10' for indexes 0 - 10
93
  *   = displays  '0'....'10' for indexes 0 - 10
94
  *   ~ displays  '1'....'11' for indexes 0 - 10
94
  *   ~ displays  '1'....'11' for indexes 0 - 10
95
  *   * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
95
  *   * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
96
  *   @ displays an axis name such as XYZUVW, or E for an extruder
96
  *   @ displays an axis name such as XYZUVW, or E for an extruder
97
  */
97
  */
98
-void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullptr*/) {
98
+void TFT_String::add(uint8_t *string, int8_t index, uint8_t *inStr/*=nullptr*/) {
99
   wchar_t wchar;
99
   wchar_t wchar;
100
 
100
 
101
   while (*string) {
101
   while (*string) {
113
       else
113
       else
114
         add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED));
114
         add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED));
115
     }
115
     }
116
-    else if (ch == '$' && itemString)
117
-      add(itemString);
116
+    else if (ch == '$' && inStr)
117
+      add(inStr);
118
     else if (ch == '@')
118
     else if (ch == '@')
119
       add_character(AXIS_CHAR(index));
119
       add_character(AXIS_CHAR(index));
120
     else
120
     else

+ 9
- 3
Marlin/src/lcd/tft/tft_string.h Visa fil

86
     static void set();
86
     static void set();
87
     static void add(uint8_t character) { add_character(character); eol(); }
87
     static void add(uint8_t character) { add_character(character); eol(); }
88
     static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH);
88
     static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH);
89
-    static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr);
89
+    static void add(uint8_t *string, int8_t index, uint8_t *inStr=nullptr);
90
     static void set(uint8_t *string) { set(); add(string); };
90
     static void set(uint8_t *string) { set(); add(string); };
91
-    static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); };
91
+    static void set(uint8_t *string, int8_t index, const char *inStr=nullptr) { set(); add(string, index, (uint8_t *)inStr); };
92
     static void set(const char *string) { set((uint8_t *)string); }
92
     static void set(const char *string) { set((uint8_t *)string); }
93
-    static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
93
+    static void set(const char *string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)string, index, inStr); }
94
     static void add(const char *string) { add((uint8_t *)string); }
94
     static void add(const char *string) { add((uint8_t *)string); }
95
 
95
 
96
+    static void add(FSTR_P const string, uint8_t max_len=MAX_STRING_LENGTH) { add((uint8_t *)FTOP(string), max_len); }
97
+    static void add(FSTR_P const string, int8_t index, uint8_t *inStr=nullptr) { add((uint8_t *)FTOP(string), index, inStr); }
98
+    static void set(FSTR_P const string) { set((uint8_t *)FTOP(string)); }
99
+    static void set(FSTR_P const string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)FTOP(string), index, inStr); }
100
+    static void add(FSTR_P const string) { add((uint8_t *)FTOP(string)); }
101
+
96
     static void trim(uint8_t character=0x20);
102
     static void trim(uint8_t character=0x20);
97
     static void rtrim(uint8_t character=0x20);
103
     static void rtrim(uint8_t character=0x20);
98
     static void ltrim(uint8_t character=0x20);
104
     static void ltrim(uint8_t character=0x20);

+ 9
- 9
Marlin/src/lcd/tft/touch.cpp Visa fil

189
       #if HAS_HOTEND
189
       #if HAS_HOTEND
190
         if (heater >= 0) { // HotEnd
190
         if (heater >= 0) { // HotEnd
191
           #if HOTENDS == 1
191
           #if HOTENDS == 1
192
-            MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
192
+            MenuItem_int3::action(GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
193
           #else
193
           #else
194
             MenuItemBase::itemIndex = heater;
194
             MenuItemBase::itemIndex = heater;
195
-            MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
195
+            MenuItem_int3::action(GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
196
           #endif
196
           #endif
197
         }
197
         }
198
       #endif
198
       #endif
199
       #if HAS_HEATED_BED
199
       #if HAS_HEATED_BED
200
         else if (heater == H_BED) {
200
         else if (heater == H_BED) {
201
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed);
201
+          MenuItem_int3::action(GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed);
202
         }
202
         }
203
       #endif
203
       #endif
204
       #if HAS_HEATED_CHAMBER
204
       #if HAS_HEATED_CHAMBER
205
         else if (heater == H_CHAMBER) {
205
         else if (heater == H_CHAMBER) {
206
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber);
206
+          MenuItem_int3::action(GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber);
207
         }
207
         }
208
       #endif
208
       #endif
209
       #if HAS_COOLER
209
       #if HAS_COOLER
210
         else if (heater == H_COOLER) {
210
         else if (heater == H_COOLER) {
211
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler);
211
+          MenuItem_int3::action(GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler);
212
         }
212
         }
213
       #endif
213
       #endif
214
 
214
 
218
       static uint8_t fan, fan_speed;
218
       static uint8_t fan, fan_speed;
219
       fan = 0;
219
       fan = 0;
220
       fan_speed = thermalManager.fan_speed[fan];
220
       fan_speed = thermalManager.fan_speed[fan];
221
-      MenuItem_percent::action((const char *)GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); });
221
+      MenuItem_percent::action(GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); });
222
       break;
222
       break;
223
     case FEEDRATE:
223
     case FEEDRATE:
224
       ui.clear_lcd();
224
       ui.clear_lcd();
225
-      MenuItem_int3::action((const char *)GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999);
225
+      MenuItem_int3::action(GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999);
226
       break;
226
       break;
227
     case FLOWRATE:
227
     case FLOWRATE:
228
       ui.clear_lcd();
228
       ui.clear_lcd();
229
       MenuItemBase::itemIndex = control->data;
229
       MenuItemBase::itemIndex = control->data;
230
       #if EXTRUDERS == 1
230
       #if EXTRUDERS == 1
231
-        MenuItem_int3::action((const char *)GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
231
+        MenuItem_int3::action(GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
232
       #else
232
       #else
233
-        MenuItem_int3::action((const char *)GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
233
+        MenuItem_int3::action(GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
234
       #endif
234
       #endif
235
       break;
235
       break;
236
 
236
 

+ 11
- 11
Marlin/src/lcd/tft/ui_1024x600.cpp Visa fil

105
 
105
 
106
   line++;
106
   line++;
107
   menu_line(line++, COLOR_KILL_SCREEN_BG);
107
   menu_line(line++, COLOR_KILL_SCREEN_BG);
108
-  tft_string.set(GET_TEXT(MSG_HALTED));
108
+  tft_string.set(GET_TEXT_F(MSG_HALTED));
109
   tft_string.trim();
109
   tft_string.trim();
110
   tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string);
110
   tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string);
111
 
111
 
112
   menu_line(line++, COLOR_KILL_SCREEN_BG);
112
   menu_line(line++, COLOR_KILL_SCREEN_BG);
113
-  tft_string.set(GET_TEXT(MSG_PLEASE_RESET));
113
+  tft_string.set(GET_TEXT_F(MSG_PLEASE_RESET));
114
   tft_string.trim();
114
   tft_string.trim();
115
   tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string);
115
   tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string);
116
 
116
 
352
 }
352
 }
353
 
353
 
354
 // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
354
 // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
355
-void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) {
355
+void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
356
   ui.encoder_direction_normal();
356
   ui.encoder_direction_normal();
357
   TERN_(TOUCH_SCREEN, touch.clear());
357
   TERN_(TOUCH_SCREEN, touch.clear());
358
 
358
 
359
   uint16_t line = 1;
359
   uint16_t line = 1;
360
 
360
 
361
   menu_line(line++);
361
   menu_line(line++);
362
-  tft_string.set(pstr, itemIndex, itemString);
362
+  tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString));
363
   tft_string.trim();
363
   tft_string.trim();
364
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
364
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
365
 
365
 
421
 }
421
 }
422
 
422
 
423
 // The Select Screen presents a prompt and two "buttons"
423
 // The Select Screen presents a prompt and two "buttons"
424
-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*/) {
424
+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*/) {
425
   uint16_t line = 1;
425
   uint16_t line = 1;
426
 
426
 
427
   if (!string) line++;
427
   if (!string) line++;
473
     #endif
473
     #endif
474
 
474
 
475
     menu_line(row);
475
     menu_line(row);
476
-    tft_string.set(GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE));
476
+    tft_string.set(GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE));
477
     tft_string.add('E');
477
     tft_string.add('E');
478
     tft_string.add((char)('1' + extruder));
478
     tft_string.add((char)('1' + extruder));
479
     tft_string.add(' ');
479
     tft_string.add(' ');
693
         drawAxisValue(axis);
693
         drawAxisValue(axis);
694
       }
694
       }
695
       else {
695
       else {
696
-        drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
696
+        drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
697
       }
697
       }
698
     #elif HAS_BED_PROBE
698
     #elif HAS_BED_PROBE
699
       // only change probe.offset.z
699
       // only change probe.offset.z
700
       probe.offset.z += diff;
700
       probe.offset.z += diff;
701
       if (direction < 0 && current_position[axis] < Z_PROBE_OFFSET_RANGE_MIN) {
701
       if (direction < 0 && current_position[axis] < Z_PROBE_OFFSET_RANGE_MIN) {
702
         current_position[axis] = Z_PROBE_OFFSET_RANGE_MIN;
702
         current_position[axis] = Z_PROBE_OFFSET_RANGE_MIN;
703
-        drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
703
+        drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
704
       }
704
       }
705
       else if (direction > 0 && current_position[axis] > Z_PROBE_OFFSET_RANGE_MAX) {
705
       else if (direction > 0 && current_position[axis] > Z_PROBE_OFFSET_RANGE_MAX) {
706
         current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX;
706
         current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX;
707
-        drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
707
+        drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
708
       }
708
       }
709
       else {
709
       else {
710
         drawMessage(""); // clear the error
710
         drawMessage(""); // clear the error
733
     #if IS_KINEMATIC
733
     #if IS_KINEMATIC
734
       UNUSED(limited);
734
       UNUSED(limited);
735
     #else
735
     #else
736
-      PGM_P const msg = limited ? GET_TEXT(MSG_LCD_SOFT_ENDSTOPS) : NUL_STR;
736
+      FSTR_P const msg = limited ? GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS) : FPSTR(NUL_STR);
737
       drawMessage(msg);
737
       drawMessage(msg);
738
     #endif
738
     #endif
739
 
739
 
766
 
766
 
767
   static void do_home() {
767
   static void do_home() {
768
     quick_feedback();
768
     quick_feedback();
769
-    drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING));
769
+    drawMessage(GET_TEXT_F(MSG_LEVEL_BED_HOMING));
770
     queue.inject_P(G28_STR);
770
     queue.inject_P(G28_STR);
771
     // Disable touch until home is done
771
     // Disable touch until home is done
772
     TERN_(TOUCH_SCREEN, touch.disable());
772
     TERN_(TOUCH_SCREEN, touch.disable());

+ 7
- 7
Marlin/src/lcd/tft/ui_320x240.cpp Visa fil

347
 }
347
 }
348
 
348
 
349
 // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
349
 // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
350
-void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) {
350
+void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
351
   ui.encoder_direction_normal();
351
   ui.encoder_direction_normal();
352
   TERN_(TOUCH_SCREEN, touch.clear());
352
   TERN_(TOUCH_SCREEN, touch.clear());
353
 
353
 
354
   uint16_t line = 1;
354
   uint16_t line = 1;
355
 
355
 
356
   menu_line(line++);
356
   menu_line(line++);
357
-  tft_string.set(pstr, itemIndex, itemString);
357
+  tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString));
358
   tft_string.trim();
358
   tft_string.trim();
359
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
359
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
360
 
360
 
416
 }
416
 }
417
 
417
 
418
 // The Select Screen presents a prompt and two "buttons"
418
 // The Select Screen presents a prompt and two "buttons"
419
-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*/) {
419
+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*/) {
420
   uint16_t line = 1;
420
   uint16_t line = 1;
421
 
421
 
422
   if (!string) line++;
422
   if (!string) line++;
621
   tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection));
621
   tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection));
622
 }
622
 }
623
 
623
 
624
-static void drawMessage(const char *msg) {
624
+static void drawMessage(PGM_P const msg) {
625
   tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20);
625
   tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20);
626
   tft.set_background(COLOR_BACKGROUND);
626
   tft.set_background(COLOR_BACKGROUND);
627
   tft.add_text(0, 0, COLOR_YELLOW, msg);
627
   tft.add_text(0, 0, COLOR_YELLOW, msg);
652
 
652
 
653
   #if ENABLED(PREVENT_COLD_EXTRUSION)
653
   #if ENABLED(PREVENT_COLD_EXTRUSION)
654
     if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
654
     if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
655
-      drawMessage("Too cold");
655
+      drawMessage(PSTR("Too cold"));
656
       return;
656
       return;
657
     }
657
     }
658
   #endif
658
   #endif
675
           probe.offset.z = new_offs;
675
           probe.offset.z = new_offs;
676
         else
676
         else
677
           TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP);
677
           TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP);
678
-        drawMessage(""); // clear the error
678
+        drawMessage(NUL_STR); // clear the error
679
         drawAxisValue(axis);
679
         drawAxisValue(axis);
680
       }
680
       }
681
       else {
681
       else {
693
         drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
693
         drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
694
       }
694
       }
695
       else {
695
       else {
696
-        drawMessage(""); // clear the error
696
+        drawMessage(NUL_STR); // clear the error
697
       }
697
       }
698
       drawAxisValue(axis);
698
       drawAxisValue(axis);
699
     #endif
699
     #endif

+ 7
- 7
Marlin/src/lcd/tft/ui_480x320.cpp Visa fil

352
 }
352
 }
353
 
353
 
354
 // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
354
 // Low-level draw_edit_screen can be used to draw an edit screen from anyplace
355
-void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) {
355
+void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
356
   ui.encoder_direction_normal();
356
   ui.encoder_direction_normal();
357
   TERN_(TOUCH_SCREEN, touch.clear());
357
   TERN_(TOUCH_SCREEN, touch.clear());
358
 
358
 
359
   uint16_t line = 1;
359
   uint16_t line = 1;
360
 
360
 
361
   menu_line(line++);
361
   menu_line(line++);
362
-  tft_string.set(pstr, itemIndex, itemString);
362
+  tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString));
363
   tft_string.trim();
363
   tft_string.trim();
364
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
364
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
365
 
365
 
421
 }
421
 }
422
 
422
 
423
 // The Select Screen presents a prompt and two "buttons"
423
 // The Select Screen presents a prompt and two "buttons"
424
-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*/) {
424
+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*/) {
425
   uint16_t line = 1;
425
   uint16_t line = 1;
426
 
426
 
427
   if (!string) line++;
427
   if (!string) line++;
622
   tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection));
622
   tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection));
623
 }
623
 }
624
 
624
 
625
-static void drawMessage(const char *msg) {
625
+static void drawMessage(PGM_P const msg) {
626
   tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34);
626
   tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34);
627
   tft.set_background(COLOR_BACKGROUND);
627
   tft.set_background(COLOR_BACKGROUND);
628
   tft.add_text(0, 0, COLOR_YELLOW, msg);
628
   tft.add_text(0, 0, COLOR_YELLOW, msg);
653
 
653
 
654
   #if ENABLED(PREVENT_COLD_EXTRUSION)
654
   #if ENABLED(PREVENT_COLD_EXTRUSION)
655
     if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
655
     if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
656
-      drawMessage("Too cold");
656
+      drawMessage(PSTR("Too cold"));
657
       return;
657
       return;
658
     }
658
     }
659
   #endif
659
   #endif
676
           probe.offset.z = new_offs;
676
           probe.offset.z = new_offs;
677
         else
677
         else
678
           TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP);
678
           TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP);
679
-        drawMessage(""); // clear the error
679
+        drawMessage(NUL_STR); // clear the error
680
         drawAxisValue(axis);
680
         drawAxisValue(axis);
681
       }
681
       }
682
       else {
682
       else {
694
         drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
694
         drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS));
695
       }
695
       }
696
       else {
696
       else {
697
-        drawMessage(""); // clear the error
697
+        drawMessage(NUL_STR); // clear the error
698
       }
698
       }
699
       drawAxisValue(axis);
699
       drawAxisValue(axis);
700
     #endif
700
     #endif

+ 8
- 8
Marlin/src/lcd/tft/ui_common.cpp Visa fil

130
 //
130
 //
131
 
131
 
132
 // Draw a generic menu item with pre_char (if selected) and post_char
132
 // Draw a generic menu item with pre_char (if selected) and post_char
133
-void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) {
133
+void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) {
134
   menu_item(row, sel);
134
   menu_item(row, sel);
135
 
135
 
136
-  uint8_t *string = (uint8_t *)pstr;
136
+  uint8_t *string = (uint8_t *)FTOP(fstr);
137
   MarlinImage image = noImage;
137
   MarlinImage image = noImage;
138
   switch (*string) {
138
   switch (*string) {
139
     case 0x01: image = imgRefresh; break;  // LCD_STR_REFRESH
139
     case 0x01: image = imgRefresh; break;  // LCD_STR_REFRESH
147
     tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, image, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
147
     tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, image, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
148
   }
148
   }
149
 
149
 
150
-  tft_string.set(string, itemIndex, itemString);
150
+  tft_string.set(string, itemIndex, FTOP(itemString));
151
   tft.add_text(offset, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
151
   tft.add_text(offset, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
152
 }
152
 }
153
 
153
 
154
 // Draw a menu item with a (potentially) editable value
154
 // Draw a menu item with a (potentially) editable value
155
-void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const data, const bool pgm) {
155
+void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const data, const bool pgm) {
156
   menu_item(row, sel);
156
   menu_item(row, sel);
157
 
157
 
158
-  tft_string.set(pstr, itemIndex, itemString);
158
+  tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString));
159
   tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
159
   tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
160
   if (data) {
160
   if (data) {
161
     tft_string.set(data);
161
     tft_string.set(data);
164
 }
164
 }
165
 
165
 
166
 // Draw a static item with no left-right margin required. Centered by default.
166
 // Draw a static item with no left-right margin required. Centered by default.
167
-void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
167
+void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
168
   menu_item(row);
168
   menu_item(row);
169
-  tft_string.set(pstr, itemIndex, itemString);
169
+  tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString));
170
   if (vstr) tft_string.add(vstr);
170
   if (vstr) tft_string.add(vstr);
171
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string);
171
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string);
172
 }
172
 }
173
 
173
 
174
 #if ENABLED(SDSUPPORT)
174
 #if ENABLED(SDSUPPORT)
175
 
175
 
176
-  void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) {
176
+  void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
177
     menu_item(row, sel);
177
     menu_item(row, sel);
178
     if (isDir) tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, imgDirectory, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
178
     if (isDir) tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, imgDirectory, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
179
     constexpr uint8_t maxlen = (MENU_ITEM_HEIGHT) - (MENU_TEXT_Y_OFFSET) + 1;
179
     constexpr uint8_t maxlen = (MENU_ITEM_HEIGHT) - (MENU_TEXT_Y_OFFSET) + 1;

Laddar…
Avbryt
Spara