Kaynağa Gözat

🎨 Apply F() to status message

Scott Lahteine 3 yıl önce
ebeveyn
işleme
7f1286a11f
44 değiştirilmiş dosya ile 194 ekleme ve 196 silme
  1. 5
    5
      Marlin/src/MarlinCore.cpp
  2. 19
    19
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  3. 1
    1
      Marlin/src/feature/cancel_object.cpp
  4. 1
    1
      Marlin/src/feature/hotend_idle.cpp
  5. 12
    12
      Marlin/src/feature/mmu/mmu2.cpp
  6. 2
    2
      Marlin/src/feature/pause.cpp
  7. 1
    1
      Marlin/src/feature/stepper_driver_safety.cpp
  8. 1
    1
      Marlin/src/feature/tmc_util.cpp
  9. 7
    7
      Marlin/src/gcode/bedlevel/G26.cpp
  10. 2
    2
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  11. 2
    2
      Marlin/src/gcode/bedlevel/mbl/G29.cpp
  12. 1
    1
      Marlin/src/gcode/calibrate/G28.cpp
  13. 3
    3
      Marlin/src/gcode/calibrate/G33.cpp
  14. 4
    4
      Marlin/src/gcode/calibrate/G34_M422.cpp
  15. 1
    1
      Marlin/src/gcode/calibrate/G76_M192_M871.cpp
  16. 3
    3
      Marlin/src/gcode/calibrate/M48.cpp
  17. 1
    1
      Marlin/src/gcode/control/M17_M18_M84.cpp
  18. 2
    2
      Marlin/src/gcode/control/M80_M81.cpp
  19. 2
    2
      Marlin/src/gcode/geometry/M206_M428.cpp
  20. 1
    1
      Marlin/src/gcode/lcd/M0_M1.cpp
  21. 1
    1
      Marlin/src/gcode/motion/G4.cpp
  22. 1
    1
      Marlin/src/gcode/queue.cpp
  23. 1
    1
      Marlin/src/gcode/temp/M140_M190.cpp
  24. 1
    1
      Marlin/src/gcode/temp/M141_M191.cpp
  25. 1
    1
      Marlin/src/gcode/temp/M143_M193.cpp
  26. 1
    1
      Marlin/src/gcode/temp/M303.cpp
  27. 6
    6
      Marlin/src/lcd/e3v2/creality/dwin.cpp
  28. 2
    2
      Marlin/src/lcd/e3v2/creality/dwin.h
  29. 29
    29
      Marlin/src/lcd/e3v2/enhanced/dwin.cpp
  30. 3
    3
      Marlin/src/lcd/e3v2/enhanced/dwin.h
  31. 1
    1
      Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp
  32. 1
    1
      Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
  33. 33
    32
      Marlin/src/lcd/marlinui.cpp
  34. 10
    13
      Marlin/src/lcd/marlinui.h
  35. 1
    1
      Marlin/src/lcd/menu/menu_advanced.cpp
  36. 1
    1
      Marlin/src/lcd/menu/menu_mixer.cpp
  37. 4
    4
      Marlin/src/lcd/menu/menu_mmu2.cpp
  38. 2
    2
      Marlin/src/module/endstops.cpp
  39. 6
    6
      Marlin/src/module/probe.cpp
  40. 3
    3
      Marlin/src/module/settings.cpp
  41. 7
    7
      Marlin/src/module/temperature.cpp
  42. 2
    2
      Marlin/src/module/tool_change.cpp
  43. 1
    1
      Marlin/src/sd/cardreader.cpp
  44. 5
    5
      Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp

+ 5
- 5
Marlin/src/MarlinCore.cpp Dosyayı Görüntüle

@@ -474,7 +474,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
474 474
     if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { // HOME_PIN goes LOW when pressed
475 475
       if (ELAPSED(ms, next_home_key_ms)) {
476 476
         next_home_key_ms = ms + HOME_DEBOUNCE_DELAY;
477
-        LCD_MESSAGEPGM(MSG_AUTO_HOME);
477
+        LCD_MESSAGE(MSG_AUTO_HOME);
478 478
         queue.inject_P(G28_STR);
479 479
       }
480 480
     }
@@ -499,8 +499,8 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
499 499
       }                                                                \
500 500
     }while(0)
501 501
 
502
-    #define CHECK_CUSTOM_USER_BUTTON(N)     _CHECK_CUSTOM_USER_BUTTON(N, NOOP)
503
-    #define CHECK_BETTER_USER_BUTTON(N) _CHECK_CUSTOM_USER_BUTTON(N, if (strlen(BUTTON##N##_DESC)) LCD_MESSAGEPGM_P(PSTR(BUTTON##N##_DESC)))
502
+    #define CHECK_CUSTOM_USER_BUTTON(N) _CHECK_CUSTOM_USER_BUTTON(N, NOOP)
503
+    #define CHECK_BETTER_USER_BUTTON(N) _CHECK_CUSTOM_USER_BUTTON(N, if (strlen(BUTTON##N##_DESC)) LCD_MESSAGE_F(BUTTON##N##_DESC))
504 504
 
505 505
     #if HAS_BETTER_USER_BUTTON(1)
506 506
       CHECK_BETTER_USER_BUTTON(1);
@@ -935,7 +935,7 @@ void stop() {
935 935
 
936 936
   if (!IsStopped()) {
937 937
     SERIAL_ERROR_MSG(STR_ERR_STOPPED);
938
-    LCD_MESSAGEPGM(MSG_STOPPED);
938
+    LCD_MESSAGE(MSG_STOPPED);
939 939
     safe_delay(350);       // allow enough time for messages to get out before stopping
940 940
     marlin_state = MF_STOPPED;
941 941
   }
@@ -1551,7 +1551,7 @@ void setup() {
1551 1551
     HMI_Init();
1552 1552
     HMI_SetLanguageCache();
1553 1553
     HMI_StartFrame(true);
1554
-    DWIN_StatusChanged_P(GET_TEXT(WELCOME_MSG));
1554
+    DWIN_StatusChanged(GET_TEXT_F(WELCOME_MSG));
1555 1555
   #endif
1556 1556
 
1557 1557
   #if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC

+ 19
- 19
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Dosyayı Görüntüle

@@ -736,7 +736,7 @@ void unified_bed_leveling::shift_mesh_height() {
736 736
 
737 737
       const uint8_t point_num = (GRID_MAX_POINTS - count) + 1;
738 738
       SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
739
-      TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
739
+      TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
740 740
 
741 741
       #if HAS_LCD_MENU
742 742
         if (ui.button_pressed()) {
@@ -789,12 +789,12 @@ void unified_bed_leveling::shift_mesh_height() {
789 789
 
790 790
 #endif // HAS_BED_PROBE
791 791
 
792
-void set_message_with_feedback(PGM_P const msg_P) {
792
+void set_message_with_feedback(FSTR_P const fstr) {
793 793
   #if HAS_LCD_MENU
794
-    ui.set_status_P(msg_P);
794
+    ui.set_status(fstr);
795 795
     ui.quick_feedback();
796 796
   #else
797
-    UNUSED(msg_P);
797
+    UNUSED(fstr);
798 798
   #endif
799 799
 }
800 800
 
@@ -850,7 +850,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
850 850
     planner.synchronize();
851 851
 
852 852
     SERIAL_ECHOPGM("Place shim under nozzle");
853
-    LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
853
+    LCD_MESSAGE(MSG_UBL_BC_INSERT);
854 854
     ui.return_to_status();
855 855
     echo_and_take_a_measurement();
856 856
 
@@ -859,7 +859,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
859 859
     planner.synchronize();
860 860
 
861 861
     SERIAL_ECHOPGM("Remove shim");
862
-    LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE);
862
+    LCD_MESSAGE(MSG_UBL_BC_REMOVE);
863 863
     echo_and_take_a_measurement();
864 864
 
865 865
     const float z2 = measure_point_with_encoder();
@@ -905,7 +905,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
905 905
 
906 906
       if (!position_is_reachable(ppos)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
907 907
 
908
-      LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
908
+      LCD_MESSAGE(MSG_UBL_MOVING_TO_NEXT);
909 909
 
910 910
       do_blocking_move_to(ppos);
911 911
       do_z_clearance(z_clearance);
@@ -917,11 +917,11 @@ void set_message_with_feedback(PGM_P const msg_P) {
917 917
 
918 918
       if (parser.seen_test('B')) {
919 919
         SERIAL_ECHOPGM("Place Shim & Measure");
920
-        LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
920
+        LCD_MESSAGE(MSG_UBL_BC_INSERT);
921 921
       }
922 922
       else {
923 923
         SERIAL_ECHOPGM("Measure");
924
-        LCD_MESSAGEPGM(MSG_UBL_BC_INSERT2);
924
+        LCD_MESSAGE(MSG_UBL_BC_INSERT2);
925 925
       }
926 926
 
927 927
       const float z_step = 0.01f;                         // 0.01mm per encoder tick, occasionally step
@@ -974,7 +974,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
974 974
 
975 975
     save_ubl_active_state_and_disable();
976 976
 
977
-    LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
977
+    LCD_MESSAGE(MSG_UBL_FINE_TUNE_MESH);
978 978
     ui.capture();                                               // Take over control of the LCD encoder
979 979
 
980 980
     do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES);  // Move to the given XY with probe clearance
@@ -1039,7 +1039,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
1039 1039
       if (_click_and_hold([]{
1040 1040
         ui.return_to_status();
1041 1041
         do_z_clearance(Z_CLEARANCE_BETWEEN_PROBES);
1042
-        set_message_with_feedback(GET_TEXT(MSG_EDITING_STOPPED));
1042
+        set_message_with_feedback(GET_TEXT_F(MSG_EDITING_STOPPED));
1043 1043
       })) break;
1044 1044
 
1045 1045
       // TODO: Disable leveling here so the Z value becomes the 'native' Z value.
@@ -1060,7 +1060,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
1060 1060
 
1061 1061
     do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES);
1062 1062
 
1063
-    LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1063
+    LCD_MESSAGE(MSG_UBL_DONE_EDITING_MESH);
1064 1064
     SERIAL_ECHOLNPGM("Done Editing Mesh");
1065 1065
 
1066 1066
     if (lcd_map_control)
@@ -1077,7 +1077,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
1077 1077
 bool unified_bed_leveling::G29_parse_parameters() {
1078 1078
   bool err_flag = false;
1079 1079
 
1080
-  set_message_with_feedback(GET_TEXT(MSG_UBL_DOING_G29));
1080
+  set_message_with_feedback(GET_TEXT_F(MSG_UBL_DOING_G29));
1081 1081
 
1082 1082
   param.C_constant = 0;
1083 1083
   param.R_repetition = 0;
@@ -1200,7 +1200,7 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() {
1200 1200
     ubl_state_recursion_chk++;
1201 1201
     if (ubl_state_recursion_chk != 1) {
1202 1202
       SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
1203
-      set_message_with_feedback(GET_TEXT(MSG_UBL_SAVE_ERROR));
1203
+      set_message_with_feedback(GET_TEXT_F(MSG_UBL_SAVE_ERROR));
1204 1204
       return;
1205 1205
     }
1206 1206
   #endif
@@ -1213,7 +1213,7 @@ void unified_bed_leveling::restore_ubl_active_state_and_leave() {
1213 1213
   #if ENABLED(UBL_DEVEL_DEBUGGING)
1214 1214
     if (--ubl_state_recursion_chk) {
1215 1215
       SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
1216
-      set_message_with_feedback(GET_TEXT(MSG_UBL_RESTORE_ERROR));
1216
+      set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR));
1217 1217
       return;
1218 1218
     }
1219 1219
   #endif
@@ -1438,7 +1438,7 @@ void unified_bed_leveling::smart_fill_mesh() {
1438 1438
 
1439 1439
     if (do_3_pt_leveling) {
1440 1440
       SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
1441
-      TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1441
+      TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1442 1442
 
1443 1443
       measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
1444 1444
       if (isnan(measured_z))
@@ -1457,7 +1457,7 @@ void unified_bed_leveling::smart_fill_mesh() {
1457 1457
 
1458 1458
       if (!abort_flag) {
1459 1459
         SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
1460
-        TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1460
+        TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1461 1461
 
1462 1462
         measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
1463 1463
         #ifdef VALIDATE_MESH_TILT
@@ -1477,7 +1477,7 @@ void unified_bed_leveling::smart_fill_mesh() {
1477 1477
 
1478 1478
       if (!abort_flag) {
1479 1479
         SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
1480
-        TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1480
+        TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1481 1481
 
1482 1482
         measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity);
1483 1483
         #ifdef VALIDATE_MESH_TILT
@@ -1518,7 +1518,7 @@ void unified_bed_leveling::smart_fill_mesh() {
1518 1518
 
1519 1519
           if (!abort_flag) {
1520 1520
             SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
1521
-            TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
1521
+            TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
1522 1522
 
1523 1523
             measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
1524 1524
 

+ 1
- 1
Marlin/src/feature/cancel_object.cpp Dosyayı Görüntüle

@@ -46,7 +46,7 @@ void CancelObject::set_active_object(const int8_t obj) {
46 46
 
47 47
   #if BOTH(HAS_STATUS_MESSAGE, CANCEL_OBJECTS_REPORTING)
48 48
     if (active_object >= 0)
49
-      ui.status_printf_P(0, PSTR(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object));
49
+      ui.status_printf(0, F(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object));
50 50
     else
51 51
       ui.reset_status();
52 52
   #endif

+ 1
- 1
Marlin/src/feature/hotend_idle.cpp Dosyayı Görüntüle

@@ -77,7 +77,7 @@ void HotendIdleProtection::check() {
77 77
 void HotendIdleProtection::timed_out() {
78 78
   next_protect_ms = 0;
79 79
   SERIAL_ECHOLNPGM("Hotend Idle Timeout");
80
-  LCD_MESSAGEPGM(MSG_HOTEND_IDLE_TIMEOUT);
80
+  LCD_MESSAGE(MSG_HOTEND_IDLE_TIMEOUT);
81 81
   HOTEND_LOOP() {
82 82
     if ((HOTEND_IDLE_NOZZLE_TARGET) < thermalManager.degTargetHotend(e))
83 83
       thermalManager.setTargetHotend(HOTEND_IDLE_NOZZLE_TARGET, e);

+ 12
- 12
Marlin/src/feature/mmu/mmu2.cpp Dosyayı Görüntüle

@@ -451,7 +451,7 @@ void MMU2::check_version() {
451 451
 }
452 452
 
453 453
 static void mmu2_not_responding() {
454
-  LCD_MESSAGEPGM(MSG_MMU2_NOT_RESPONDING);
454
+  LCD_MESSAGE(MSG_MMU2_NOT_RESPONDING);
455 455
   BUZZ(100, 659);
456 456
   BUZZ(200, 698);
457 457
   BUZZ(100, 659);
@@ -487,7 +487,7 @@ static void mmu2_not_responding() {
487 487
     if (index != extruder) {
488 488
 
489 489
       stepper.disable_extruder();
490
-      ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
490
+      ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
491 491
 
492 492
       command(MMU_CMD_T0 + index);
493 493
       manage_response(true, true);
@@ -573,7 +573,7 @@ static void mmu2_not_responding() {
573 573
         command(MMU_CMD_U0);
574 574
         manage_response(true, true);
575 575
       }
576
-      ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
576
+      ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
577 577
       mmu_loading_flag = true;
578 578
       command(MMU_CMD_T0 + index);
579 579
       manage_response(true, true);
@@ -671,7 +671,7 @@ static void mmu2_not_responding() {
671 671
 
672 672
     if (index != extruder) {
673 673
       stepper.disable_extruder();
674
-      ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
674
+      ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
675 675
       command(MMU_CMD_T0 + index);
676 676
       manage_response(true, true);
677 677
       command(MMU_CMD_C0);
@@ -808,14 +808,14 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
808 808
 
809 809
       if (turn_off_nozzle && resume_hotend_temp) {
810 810
         thermalManager.setTargetHotend(resume_hotend_temp, active_extruder);
811
-        LCD_MESSAGEPGM(MSG_HEATING);
811
+        LCD_MESSAGE(MSG_HEATING);
812 812
         BUZZ(200, 40);
813 813
 
814 814
         while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000);
815 815
       }
816 816
 
817 817
       if (move_axes && all_axes_homed()) {
818
-        LCD_MESSAGEPGM(MSG_MMU2_RESUMING);
818
+        LCD_MESSAGE(MSG_MMU2_RESUMING);
819 819
         BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404);
820 820
 
821 821
         // Move XY to starting position, then Z
@@ -826,7 +826,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
826 826
       }
827 827
       else {
828 828
         BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404);
829
-        LCD_MESSAGEPGM(MSG_MMU2_RESUMING);
829
+        LCD_MESSAGE(MSG_MMU2_RESUMING);
830 830
       }
831 831
     }
832 832
   }
@@ -908,7 +908,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) {
908 908
 
909 909
   if (thermalManager.tooColdToExtrude(active_extruder)) {
910 910
     BUZZ(200, 404);
911
-    LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD);
911
+    LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
912 912
     return false;
913 913
   }
914 914
 
@@ -944,11 +944,11 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
944 944
 
945 945
   if (thermalManager.tooColdToExtrude(active_extruder)) {
946 946
     BUZZ(200, 404);
947
-    LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD);
947
+    LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
948 948
     return false;
949 949
   }
950 950
 
951
-  LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
951
+  LCD_MESSAGE(MSG_MMU2_EJECTING_FILAMENT);
952 952
 
953 953
   stepper.enable_extruder();
954 954
   current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
@@ -958,7 +958,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
958 958
   manage_response(false, false);
959 959
 
960 960
   if (recover)  {
961
-    LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
961
+    LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
962 962
     BUZZ(200, 404);
963 963
     TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR));
964 964
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")));
@@ -993,7 +993,7 @@ bool MMU2::unload() {
993 993
 
994 994
   if (thermalManager.tooColdToExtrude(active_extruder)) {
995 995
     BUZZ(200, 404);
996
-    LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD);
996
+    LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
997 997
     return false;
998 998
   }
999 999
 

+ 2
- 2
Marlin/src/feature/pause.cpp Dosyayı Görüntüle

@@ -538,7 +538,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
538 538
 
539 539
       TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged_P(GET_TEXT(MSG_REHEATING)));
540 540
 
541
-      TERN_(DWIN_CREALITY_LCD_ENHANCED, ui.set_status_P(GET_TEXT(MSG_REHEATING)));
541
+      TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATING));
542 542
 
543 543
       // Re-enable the heaters if they timed out
544 544
       HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
@@ -556,7 +556,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
556 556
 
557 557
       TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_REHEATDONE), CONTINUE_STR));
558 558
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_REHEATDONE)));
559
-      TERN_(DWIN_CREALITY_LCD_ENHANCED, ui.set_status_P(GET_TEXT(MSG_REHEATDONE)));
559
+      TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
560 560
 
561 561
       IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true);
562 562
 

+ 1
- 1
Marlin/src/feature/stepper_driver_safety.cpp Dosyayı Görüntüle

@@ -32,7 +32,7 @@ void stepper_driver_backward_error(PGM_P str) {
32 32
   SERIAL_ERROR_START();
33 33
   SERIAL_ECHOPGM_P(str);
34 34
   SERIAL_ECHOLNPGM(" driver is backward!");
35
-  ui.status_printf_P(2, PSTR(S_FMT S_FMT), str, GET_TEXT(MSG_DRIVER_BACKWARD));
35
+  ui.status_printf(2, F(S_FMT S_FMT), str, GET_TEXT(MSG_DRIVER_BACKWARD));
36 36
 }
37 37
 
38 38
 void stepper_driver_backward_check() {

+ 1
- 1
Marlin/src/feature/tmc_util.cpp Dosyayı Görüntüle

@@ -1341,7 +1341,7 @@ void test_tmc_connection(LOGICAL_AXIS_ARGS(const bool)) {
1341 1341
     #endif
1342 1342
   }
1343 1343
 
1344
-  if (axis_connection) LCD_MESSAGEPGM(MSG_ERROR_TMC);
1344
+  if (axis_connection) LCD_MESSAGE(MSG_ERROR_TMC);
1345 1345
 }
1346 1346
 
1347 1347
 #endif // HAS_TRINAMIC_CONFIG

+ 7
- 7
Marlin/src/gcode/bedlevel/G26.cpp Dosyayı Görüntüle

@@ -163,7 +163,7 @@ float g26_random_deviation = 0.0;
163 163
    */
164 164
   bool user_canceled() {
165 165
     if (!ui.button_pressed()) return false; // Return if the button isn't pressed
166
-    ui.set_status_P(GET_TEXT(MSG_G26_CANCELED), 99);
166
+    ui.set_status(GET_TEXT_F(MSG_G26_CANCELED), 99);
167 167
     TERN_(HAS_LCD_MENU, ui.quick_feedback());
168 168
     ui.wait_for_release();
169 169
     return true;
@@ -323,7 +323,7 @@ typedef struct {
323 323
 
324 324
       if (bed_temp > 25) {
325 325
         #if HAS_WIRED_LCD
326
-          ui.set_status_P(GET_TEXT(MSG_G26_HEATING_BED), 99);
326
+          ui.set_status(GET_TEXT_F(MSG_G26_HEATING_BED), 99);
327 327
           ui.quick_feedback();
328 328
           TERN_(HAS_LCD_MENU, ui.capture());
329 329
         #endif
@@ -342,7 +342,7 @@ typedef struct {
342 342
 
343 343
     // Start heating the active nozzle
344 344
     #if HAS_WIRED_LCD
345
-      ui.set_status_P(GET_TEXT(MSG_G26_HEATING_NOZZLE), 99);
345
+      ui.set_status(GET_TEXT_F(MSG_G26_HEATING_NOZZLE), 99);
346 346
       ui.quick_feedback();
347 347
     #endif
348 348
     thermalManager.setTargetHotend(hotend_temp, active_extruder);
@@ -372,7 +372,7 @@ typedef struct {
372 372
 
373 373
       if (prime_flag == -1) {  // The user wants to control how much filament gets purged
374 374
         ui.capture();
375
-        ui.set_status_P(GET_TEXT(MSG_G26_MANUAL_PRIME), 99);
375
+        ui.set_status(GET_TEXT_F(MSG_G26_MANUAL_PRIME), 99);
376 376
         ui.chirp();
377 377
 
378 378
         destination = current_position;
@@ -399,7 +399,7 @@ typedef struct {
399 399
 
400 400
         ui.wait_for_release();
401 401
 
402
-        ui.set_status_P(GET_TEXT(MSG_G26_PRIME_DONE), 99);
402
+        ui.set_status(GET_TEXT_F(MSG_G26_PRIME_DONE), 99);
403 403
         ui.quick_feedback();
404 404
         ui.release();
405 405
       }
@@ -407,7 +407,7 @@ typedef struct {
407 407
     #endif
408 408
     {
409 409
       #if HAS_WIRED_LCD
410
-        ui.set_status_P(GET_TEXT(MSG_G26_FIXED_LENGTH), 99);
410
+        ui.set_status(GET_TEXT_F(MSG_G26_FIXED_LENGTH), 99);
411 411
         ui.quick_feedback();
412 412
       #endif
413 413
       destination = current_position;
@@ -854,7 +854,7 @@ void GcodeSuite::G26() {
854 854
   } while (--g26_repeats && location.valid());
855 855
 
856 856
   LEAVE:
857
-  ui.set_status_P(GET_TEXT(MSG_G26_LEAVING), -1);
857
+  ui.set_status(GET_TEXT_F(MSG_G26_LEAVING), -1);
858 858
   TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, ExtUI::G26_FINISH));
859 859
 
860 860
   g26.retract_filament(destination);

+ 2
- 2
Marlin/src/gcode/bedlevel/abl/G29.cpp Dosyayı Görüntüle

@@ -636,7 +636,7 @@ G29_TYPE GcodeSuite::G29() {
636 636
           if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue;
637 637
 
638 638
           if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, ".");
639
-          TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
639
+          TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
640 640
 
641 641
           abl.measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
642 642
 
@@ -681,7 +681,7 @@ G29_TYPE GcodeSuite::G29() {
681 681
 
682 682
       LOOP_L_N(i, 3) {
683 683
         if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing point ", i + 1, "/3.");
684
-        TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1)));
684
+        TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1)));
685 685
 
686 686
         // Retain the last probe position
687 687
         abl.probePos = xy_pos_t(points[i]);

+ 2
- 2
Marlin/src/gcode/bedlevel/mbl/G29.cpp Dosyayı Görüntüle

@@ -152,7 +152,7 @@ void GcodeSuite::G29() {
152 152
         // After recording the last point, activate home and activate
153 153
         mbl_probe_index = -1;
154 154
         SERIAL_ECHOLNPGM("Mesh probing done.");
155
-        TERN_(HAS_STATUS_MESSAGE, ui.set_status(GET_TEXT(MSG_MESH_DONE)));
155
+        TERN_(HAS_STATUS_MESSAGE, LCD_MESSAGE(MSG_MESH_DONE));
156 156
         BUZZ(100, 659);
157 157
         BUZZ(100, 698);
158 158
 
@@ -214,7 +214,7 @@ void GcodeSuite::G29() {
214 214
 
215 215
   if (state == MeshNext) {
216 216
     SERIAL_ECHOLNPGM("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS);
217
-    if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
217
+    if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
218 218
   }
219 219
 
220 220
   report_current_position();

+ 1
- 1
Marlin/src/gcode/calibrate/G28.cpp Dosyayı Görüntüle

@@ -156,7 +156,7 @@
156 156
       homeaxis(Z_AXIS);
157 157
     }
158 158
     else {
159
-      LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
159
+      LCD_MESSAGE(MSG_ZPROBE_OUT);
160 160
       SERIAL_ECHO_MSG(STR_ZPROBE_OUT_SER);
161 161
     }
162 162
   }

+ 3
- 3
Marlin/src/gcode/calibrate/G33.cpp Dosyayı Görüntüle

@@ -477,11 +477,11 @@ void GcodeSuite::G33() {
477 477
   SERIAL_ECHOLNPGM("G33 Auto Calibrate");
478 478
 
479 479
   // Report settings
480
-  PGM_P const checkingac = PSTR("Checking... AC");
481
-  SERIAL_ECHOPGM_P(checkingac);
480
+  FSTR_P const checkingac = F("Checking... AC");
481
+  SERIAL_ECHOF(checkingac);
482 482
   if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
483 483
   SERIAL_EOL();
484
-  ui.set_status_P(checkingac);
484
+  ui.set_status(checkingac);
485 485
 
486 486
   print_calibration_settings(_endstop_results, _angle_results);
487 487
 

+ 4
- 4
Marlin/src/gcode/calibrate/G34_M422.cpp Dosyayı Görüntüle

@@ -31,7 +31,7 @@
31 31
 #include "../../module/stepper.h"
32 32
 #include "../../module/planner.h"
33 33
 #include "../../module/probe.h"
34
-#include "../../lcd/marlinui.h" // for LCD_MESSAGEPGM
34
+#include "../../lcd/marlinui.h" // for LCD_MESSAGE
35 35
 
36 36
 #if HAS_LEVELING
37 37
   #include "../../feature/bedlevel/bedlevel.h"
@@ -229,7 +229,7 @@ void GcodeSuite::G34() {
229 229
           const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false);
230 230
           if (isnan(z_probed_height)) {
231 231
             SERIAL_ECHOLNPGM("Probing failed");
232
-            LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED);
232
+            LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
233 233
             err_break = true;
234 234
             break;
235 235
           }
@@ -328,7 +328,7 @@ void GcodeSuite::G34() {
328 328
         auto decreasing_accuracy = [](const_float_t v1, const_float_t v2) {
329 329
           if (v1 < v2 * 0.7f) {
330 330
             SERIAL_ECHOLNPGM("Decreasing Accuracy Detected.");
331
-            LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY);
331
+            LCD_MESSAGE(MSG_DECREASING_ACCURACY);
332 332
             return true;
333 333
           }
334 334
           return false;
@@ -411,7 +411,7 @@ void GcodeSuite::G34() {
411 411
 
412 412
         if (success_break) {
413 413
           SERIAL_ECHOLNPGM("Target accuracy achieved.");
414
-          LCD_MESSAGEPGM(MSG_ACCURACY_ACHIEVED);
414
+          LCD_MESSAGE(MSG_ACCURACY_ACHIEVED);
415 415
           break;
416 416
         }
417 417
 

+ 1
- 1
Marlin/src/gcode/calibrate/G76_M192_M871.cpp Dosyayı Görüntüle

@@ -351,7 +351,7 @@ void GcodeSuite::M192() {
351 351
   }
352 352
 
353 353
   const celsius_t target_temp = parser.value_celsius();
354
-  ui.set_status_P(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT(MSG_PROBE_HEATING) : GET_TEXT(MSG_PROBE_COOLING));
354
+  ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
355 355
   thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
356 356
 }
357 357
 

+ 3
- 3
Marlin/src/gcode/calibrate/M48.cpp Dosyayı Görüntüle

@@ -79,7 +79,7 @@ void GcodeSuite::M48() {
79 79
   };
80 80
 
81 81
   if (!probe.can_reach(test_position)) {
82
-    ui.set_status_P(GET_TEXT(MSG_M48_OUT_OF_BOUNDS), 99);
82
+    ui.set_status(GET_TEXT_F(MSG_M48_OUT_OF_BOUNDS), 99);
83 83
     SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
84 84
     return;
85 85
   }
@@ -144,7 +144,7 @@ void GcodeSuite::M48() {
144 144
     LOOP_L_N(n, n_samples) {
145 145
       #if HAS_STATUS_MESSAGE
146 146
         // Display M48 progress in the status bar
147
-        ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
147
+        ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
148 148
       #endif
149 149
 
150 150
       // When there are "legs" of movement move around the point before probing
@@ -260,7 +260,7 @@ void GcodeSuite::M48() {
260 260
     #if HAS_STATUS_MESSAGE
261 261
       // Display M48 results in the status bar
262 262
       char sigma_str[8];
263
-      ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
263
+      ui.status_printf(0, F(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
264 264
     #endif
265 265
   }
266 266
 

+ 1
- 1
Marlin/src/gcode/control/M17_M18_M84.cpp Dosyayı Görüntüle

@@ -136,7 +136,7 @@ void GcodeSuite::M17() {
136 136
     }
137 137
   }
138 138
   else {
139
-    LCD_MESSAGEPGM(MSG_NO_MOVE);
139
+    LCD_MESSAGE(MSG_NO_MOVE);
140 140
     stepper.enable_all_steppers();
141 141
   }
142 142
 }

+ 2
- 2
Marlin/src/gcode/control/M80_M81.cpp Dosyayı Görüntüle

@@ -25,7 +25,7 @@
25 25
 #include "../../module/temperature.h"
26 26
 #include "../../module/planner.h"       // for planner.finish_and_disable
27 27
 #include "../../module/printcounter.h"  // for print_job_timer.stop
28
-#include "../../lcd/marlinui.h"         // for LCD_MESSAGEPGM_P
28
+#include "../../lcd/marlinui.h"         // for LCD_MESSAGE_F
29 29
 
30 30
 #include "../../inc/MarlinConfig.h"
31 31
 
@@ -95,5 +95,5 @@ void GcodeSuite::M81() {
95 95
     powerManager.power_off_soon();
96 96
   #endif
97 97
 
98
-  LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF "."));
98
+  LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF ".");
99 99
 }

+ 2
- 2
Marlin/src/gcode/geometry/M206_M428.cpp Dosyayı Görüntüle

@@ -91,7 +91,7 @@ void GcodeSuite::M428() {
91 91
       diff[i] = -current_position[i];
92 92
     if (!WITHIN(diff[i], -20, 20)) {
93 93
       SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR);
94
-      LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!"));
94
+      LCD_ALERTMESSAGE_F("Err: Too far!");
95 95
       BUZZ(200, 40);
96 96
       return;
97 97
     }
@@ -99,7 +99,7 @@ void GcodeSuite::M428() {
99 99
 
100 100
   LOOP_LINEAR_AXES(i) set_home_offset((AxisEnum)i, diff[i]);
101 101
   report_current_position();
102
-  LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED);
102
+  LCD_MESSAGE(MSG_HOME_OFFSETS_APPLIED);
103 103
   BUZZ(100, 659);
104 104
   BUZZ(100, 698);
105 105
 }

+ 1
- 1
Marlin/src/gcode/lcd/M0_M1.cpp Dosyayı Görüntüle

@@ -59,7 +59,7 @@ void GcodeSuite::M0_M1() {
59 59
     if (parser.string_arg)
60 60
       ui.set_status(parser.string_arg, true);
61 61
     else {
62
-      LCD_MESSAGEPGM(MSG_USERWAIT);
62
+      LCD_MESSAGE(MSG_USERWAIT);
63 63
       #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
64 64
         ui.reset_progress_bar_timeout();
65 65
       #endif

+ 1
- 1
Marlin/src/gcode/motion/G4.cpp Dosyayı Görüntüle

@@ -38,7 +38,7 @@ void GcodeSuite::G4() {
38 38
     SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
39 39
   #endif
40 40
 
41
-  if (!ui.has_status()) LCD_MESSAGEPGM(MSG_DWELL);
41
+  if (!ui.has_status()) LCD_MESSAGE(MSG_DWELL);
42 42
 
43 43
   dwell(dwell_ms);
44 44
 }

+ 1
- 1
Marlin/src/gcode/queue.cpp Dosyayı Görüntüle

@@ -513,7 +513,7 @@ void GCodeQueue::get_serial_commands() {
513 513
               TERN_(BEZIER_CURVE_SUPPORT, case 5:)
514 514
                 PORT_REDIRECT(SERIAL_PORTMASK(p));     // Reply to the serial port that sent the command
515 515
                 SERIAL_ECHOLNPGM(STR_ERR_STOPPED);
516
-                LCD_MESSAGEPGM(MSG_STOPPED);
516
+                LCD_MESSAGE(MSG_STOPPED);
517 517
                 break;
518 518
             }
519 519
           }

+ 1
- 1
Marlin/src/gcode/temp/M140_M190.cpp Dosyayı Görüntüle

@@ -83,7 +83,7 @@ void GcodeSuite::M140_M190(const bool isM190) {
83 83
 
84 84
   thermalManager.setTargetBed(temp);
85 85
 
86
-  ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));
86
+  ui.set_status(thermalManager.isHeatingBed() ? GET_TEXT_F(MSG_BED_HEATING) : GET_TEXT_F(MSG_BED_COOLING));
87 87
 
88 88
   // with PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it
89 89
   TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190));

+ 1
- 1
Marlin/src/gcode/temp/M141_M191.cpp Dosyayı Görüntüle

@@ -69,7 +69,7 @@ void GcodeSuite::M191() {
69 69
 
70 70
   const bool is_heating = thermalManager.isHeatingChamber();
71 71
   if (is_heating || !no_wait_for_cooling) {
72
-    ui.set_status_P(is_heating ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING));
72
+    ui.set_status(is_heating ? GET_TEXT_F(MSG_CHAMBER_HEATING) : GET_TEXT_F(MSG_CHAMBER_COOLING));
73 73
     thermalManager.wait_for_chamber(false);
74 74
   }
75 75
 }

+ 1
- 1
Marlin/src/gcode/temp/M143_M193.cpp Dosyayı Görüntüle

@@ -58,7 +58,7 @@ void GcodeSuite::M193() {
58 58
     cooler.enable();
59 59
     thermalManager.setTargetCooler(parser.value_celsius());
60 60
     if (thermalManager.isLaserCooling()) {
61
-      ui.set_status_P(GET_TEXT(MSG_LASER_COOLING));
61
+      LCD_MESSAGE(MSG_LASER_COOLING);
62 62
       thermalManager.wait_for_cooler(true);
63 63
     }
64 64
   }

+ 1
- 1
Marlin/src/gcode/temp/M303.cpp Dosyayı Görüntüle

@@ -85,7 +85,7 @@ void GcodeSuite::M303() {
85 85
     KEEPALIVE_STATE(NOT_BUSY);
86 86
   #endif
87 87
 
88
-  LCD_MESSAGEPGM(MSG_PID_AUTOTUNE);
88
+  LCD_MESSAGE(MSG_PID_AUTOTUNE);
89 89
   thermalManager.PID_autotune(temp, hid, c, u);
90 90
   ui.reset_status();
91 91
 }

+ 6
- 6
Marlin/src/lcd/e3v2/creality/dwin.cpp Dosyayı Görüntüle

@@ -4287,16 +4287,16 @@ void DWIN_CompletedLeveling() {
4287 4287
   if (checkkey == Leveling) Goto_MainMenu();
4288 4288
 }
4289 4289
 
4290
-void DWIN_StatusChanged(const char *text) {
4290
+void DWIN_StatusChanged(const char * const cstr/*=nullptr*/) {
4291 4291
   DWIN_Draw_Rectangle(1, Color_Bg_Blue, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 24);
4292
-  const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(text) * MENU_CHR_W) / 2;
4293
-  DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 3, F(text));
4292
+  const int8_t x = _MAX(0U, DWIN_WIDTH - strlen(cstr) * MENU_CHR_W) / 2;
4293
+  DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 3, cstr);
4294 4294
   DWIN_UpdateLCD();
4295 4295
 }
4296 4296
 
4297
-void DWIN_StatusChanged_P(PGM_P const pstr) {
4298
-  char str[strlen_P((const char*)pstr) + 1];
4299
-  strcpy_P(str, (const char*)pstr);
4297
+void DWIN_StatusChanged(FSTR_P const fstr) {
4298
+  char str[strlen_P(FTOP(fstr)) + 1];
4299
+  strcpy_P(str, FTOP(fstr));
4300 4300
   DWIN_StatusChanged(str);
4301 4301
 }
4302 4302
 

+ 2
- 2
Marlin/src/lcd/e3v2/creality/dwin.h Dosyayı Görüntüle

@@ -244,8 +244,8 @@ void HMI_Init();
244 244
 void DWIN_Update();
245 245
 void EachMomentUpdate();
246 246
 void DWIN_HandleScreen();
247
-void DWIN_StatusChanged(const char *text);
248
-void DWIN_StatusChanged_P(PGM_P const pstr);
247
+void DWIN_StatusChanged(const char * const cstr=nullptr);
248
+void DWIN_StatusChanged(FSTR_P const fstr);
249 249
 
250 250
 inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
251 251
 

+ 29
- 29
Marlin/src/lcd/e3v2/enhanced/dwin.cpp Dosyayı Görüntüle

@@ -713,7 +713,7 @@ void Draw_Main_Menu() {
713 713
 
714 714
 void Goto_Main_Menu() {
715 715
   checkkey = MainMenu;
716
-  DWIN_StatusChanged(nullptr);
716
+  DWIN_StatusChanged();
717 717
   Draw_Main_Menu();
718 718
 }
719 719
 
@@ -1756,20 +1756,20 @@ void DWIN_Startup() {
1756 1756
   HMI_SetLanguage();
1757 1757
 }
1758 1758
 
1759
-void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char *text) {
1759
+void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char * const text/*=nullptr*/) {
1760 1760
   DWIN_Draw_Rectangle(1, bgcolor, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
1761 1761
   if (text) DWINUI::Draw_CenteredString(color, STATUS_Y + 2, text);
1762 1762
   DWIN_UpdateLCD();
1763 1763
 }
1764 1764
 
1765 1765
 // Update Status line
1766
-void DWIN_StatusChanged(const char *text) {
1767
-  DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, text);
1766
+void DWIN_StatusChanged(const char * const cstr/*=nullptr*/) {
1767
+  DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, cstr);
1768 1768
 }
1769 1769
 
1770
-void DWIN_StatusChanged_P(PGM_P const pstr) {
1771
-  char str[strlen_P((const char*)pstr) + 1];
1772
-  strcpy_P(str, (const char*)pstr);
1770
+void DWIN_StatusChanged(FSTR_P const fstr) {
1771
+  char str[strlen_P(FTOP(fstr)) + 1];
1772
+  strcpy_P(str, FTOP(fstr));
1773 1773
   DWIN_StatusChanged(str);
1774 1774
 }
1775 1775
 
@@ -1804,7 +1804,7 @@ void DWIN_Progress_Update() {
1804 1804
 
1805 1805
 #if HAS_FILAMENT_SENSOR
1806 1806
   // Filament Runout process
1807
-  void DWIN_FilamentRunout(const uint8_t extruder) { ui.set_status_P(GET_TEXT(MSG_RUNOUT_SENSOR)); }
1807
+  void DWIN_FilamentRunout(const uint8_t extruder) { LCD_MESSAGE(MSG_RUNOUT_SENSOR); }
1808 1808
 #endif
1809 1809
 
1810 1810
 void DWIN_SetColorDefaults() {
@@ -1889,7 +1889,7 @@ void DWIN_Redraw_screen() {
1889 1889
       case PAUSE_MESSAGE_OPTION:   DWIN_Popup_FilamentPurge(); break;
1890 1890
       case PAUSE_MESSAGE_RESUME:   DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break;
1891 1891
       case PAUSE_MESSAGE_HEAT:     DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E);   break;
1892
-      case PAUSE_MESSAGE_HEATING:  ui.set_status_P(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); break;
1892
+      case PAUSE_MESSAGE_HEATING:  LCD_MESSAGE(MSG_FILAMENT_CHANGE_HEATING); break;
1893 1893
       case PAUSE_MESSAGE_STATUS:   HMI_ReturnScreen(); break;
1894 1894
       default: break;
1895 1895
     }
@@ -2181,7 +2181,7 @@ void SetMoveZto0() {
2181 2181
   );
2182 2182
   gcode.process_subcommands_now(cmd);
2183 2183
   planner.synchronize();
2184
-  ui.set_status_P(PSTR("Now adjust Z Offset"));
2184
+  LCD_MESSAGE_F("Now adjust Z Offset");
2185 2185
   HMI_AudioFeedback(true);
2186 2186
 }
2187 2187
 
@@ -2238,7 +2238,7 @@ void Goto_LockScreen() { DWIN_LockScreen(true); }
2238 2238
   void SetProbeOffsetY() { SetPFloatOnClick(-50, 50, UNITFDIGITS); }
2239 2239
   void SetProbeOffsetZ() { SetPFloatOnClick(-10, 10, 2); }
2240 2240
   void ProbeTest() {
2241
-    ui.set_status_P(GET_TEXT(MSG_M48_TEST));
2241
+    LCD_MESSAGE(MSG_M48_TEST);
2242 2242
     queue.inject(F("G28O\nM48 P10"));
2243 2243
   }
2244 2244
 #endif
@@ -2295,7 +2295,7 @@ void DWIN_ApplyColor() {
2295 2295
   DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color);
2296 2296
   Draw_Status_Area(false);
2297 2297
   Draw_SelectColors_Menu();
2298
-  ui.set_status_P(PSTR("Colors applied"));
2298
+  LCD_MESSAGE_F("Colors applied");
2299 2299
 }
2300 2300
 
2301 2301
 void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); }
@@ -2323,18 +2323,18 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); }
2323 2323
   }
2324 2324
 
2325 2325
   void ParkHead(){
2326
-    ui.set_status_P(GET_TEXT(MSG_FILAMENT_PARK_ENABLED));
2326
+    LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED);
2327 2327
     queue.inject(F("G28O\nG27"));
2328 2328
   }
2329 2329
 
2330 2330
   #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
2331 2331
     void UnloadFilament(){
2332
-      ui.set_status_P(GET_TEXT(MSG_FILAMENTUNLOAD));
2332
+      LCD_MESSAGE(MSG_FILAMENTUNLOAD);
2333 2333
       queue.inject(F("M702 Z20"));
2334 2334
     }
2335 2335
 
2336 2336
     void LoadFilament(){
2337
-      ui.set_status_P(GET_TEXT(MSG_FILAMENTLOAD));
2337
+      LCD_MESSAGE(MSG_FILAMENTLOAD);
2338 2338
       queue.inject(F("M701 Z20"));
2339 2339
     }
2340 2340
   #endif
@@ -2359,23 +2359,23 @@ void LevBed(uint8_t point) {
2359 2359
 
2360 2360
   switch (point) {
2361 2361
     case 0:
2362
-      ui.set_status_P(GET_TEXT(MSG_LEVBED_FL));
2362
+      LCD_MESSAGE(MSG_LEVBED_FL);
2363 2363
       xpos = ypos = margin;
2364 2364
       break;
2365 2365
     case 1:
2366
-      ui.set_status_P(GET_TEXT(MSG_LEVBED_FR));
2366
+      LCD_MESSAGE(MSG_LEVBED_FR);
2367 2367
       xpos = X_BED_SIZE - margin; ypos = margin;
2368 2368
       break;
2369 2369
     case 2:
2370
-      ui.set_status_P(GET_TEXT(MSG_LEVBED_BR));
2370
+      LCD_MESSAGE(MSG_LEVBED_BR);
2371 2371
       xpos = X_BED_SIZE - margin; ypos = Y_BED_SIZE - margin;
2372 2372
       break;
2373 2373
     case 3:
2374
-      ui.set_status_P(GET_TEXT(MSG_LEVBED_BL));
2374
+      LCD_MESSAGE(MSG_LEVBED_BL);
2375 2375
       xpos = margin; ypos = Y_BED_SIZE - margin;
2376 2376
       break;
2377 2377
     case 4:
2378
-      ui.set_status_P(GET_TEXT(MSG_LEVBED_C));
2378
+      LCD_MESSAGE(MSG_LEVBED_C);
2379 2379
       xpos = X_BED_SIZE / 2; ypos = Y_BED_SIZE / 2;
2380 2380
       break;
2381 2381
   }
@@ -2390,7 +2390,7 @@ void LevBed(uint8_t point) {
2390 2390
       dtostrf(ypos, 1, 1, str_2),
2391 2391
       dtostrf(zval, 1, 2, str_3)
2392 2392
     );
2393
-    ui.set_status_P(cmd);
2393
+    ui.set_status(cmd);
2394 2394
   #else
2395 2395
     planner.synchronize();
2396 2396
     sprintf_P(cmd, PSTR(fmt), xpos, ypos);
@@ -2407,7 +2407,7 @@ void LevBedC () { LevBed(4); }
2407 2407
 #if ENABLED(MESH_BED_LEVELING)
2408 2408
 
2409 2409
   void ManualMeshStart(){
2410
-    ui.set_status_P(GET_TEXT(MSG_UBL_BUILD_MESH_MENU));
2410
+    LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU);
2411 2411
     gcode.process_subcommands_now(F("G28 XYO\nG28 Z\nM211 S0\nG29S1"));
2412 2412
     planner.synchronize();
2413 2413
     #ifdef MANUAL_PROBE_START_Z
@@ -2432,7 +2432,7 @@ void LevBedC () { LevBed(4); }
2432 2432
   }
2433 2433
 
2434 2434
   void ManualMeshSave(){
2435
-    ui.set_status_P(GET_TEXT(MSG_UBL_STORAGE_MESH_MENU));
2435
+    LCD_MESSAGE(MSG_UBL_STORAGE_MESH_MENU);
2436 2436
     queue.inject(F("M211 S1\nM500"));
2437 2437
   }
2438 2438
 
@@ -3089,11 +3089,11 @@ void HMI_SetPFloat() {
3089 3089
 
3090 3090
 // Menu Creation and Drawing functions ======================================================
3091 3091
 
3092
-void SetMenuTitle(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* text) {
3092
+void SetMenuTitle(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* fstr) {
3093 3093
   if (HMI_IsChinese() && (cn.w != 0))
3094 3094
     CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h);
3095 3095
   else
3096
-    CurrentMenu->MenuTitle.SetCaption(text);
3096
+    CurrentMenu->MenuTitle.SetCaption(fstr);
3097 3097
 }
3098 3098
 
3099 3099
 void Draw_Prepare_Menu() {
@@ -3231,7 +3231,7 @@ void Draw_Move_Menu() {
3231 3231
     #endif
3232 3232
   }
3233 3233
   CurrentMenu->draw();
3234
-  if (!all_axes_trusted()) ui.set_status_P(PSTR("WARNING: position is unknow"));
3234
+  if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: position is unknown");
3235 3235
 }
3236 3236
 
3237 3237
 #if HAS_HOME_OFFSET
@@ -3437,11 +3437,11 @@ void Draw_Motion_Menu() {
3437 3437
 
3438 3438
 #if HAS_PREHEAT
3439 3439
 
3440
-  void Draw_Preheat_Menu(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* text) {
3440
+  void Draw_Preheat_Menu(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* fstr) {
3441 3441
     checkkey = Menu;
3442 3442
     if (CurrentMenu != PreheatMenu) {
3443 3443
       CurrentMenu = PreheatMenu;
3444
-      SetMenuTitle(cn, en, text);
3444
+      SetMenuTitle(cn, en, fstr);
3445 3445
       DWINUI::MenuItemsPrepare(5);
3446 3446
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu);
3447 3447
       #if HAS_HOTEND
@@ -3645,7 +3645,7 @@ void Draw_Steps_Menu() {
3645 3645
       ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR);
3646 3646
     }
3647 3647
     CurrentMenu->draw();
3648
-    if (!axis_is_trusted(Z_AXIS)) ui.set_status_P(PSTR("WARNING: Z position is unknow, move Z to home"));
3648
+    if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home");
3649 3649
   }
3650 3650
 #endif
3651 3651
 

+ 3
- 3
Marlin/src/lcd/e3v2/enhanced/dwin.h Dosyayı Görüntüle

@@ -179,9 +179,9 @@ void EachMomentUpdate();
179 179
 void update_variable();
180 180
 void DWIN_HandleScreen();
181 181
 void DWIN_Update();
182
-void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char *text);
183
-void DWIN_StatusChanged(const char * const text);
184
-void DWIN_StatusChanged_P(PGM_P const text);
182
+void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char *text=nullptr);
183
+void DWIN_StatusChanged(const char * const cstr=nullptr);
184
+void DWIN_StatusChanged(FSTR_P const fstr);
185 185
 void DWIN_StartHoming();
186 186
 void DWIN_CompletedHoming();
187 187
 #if HAS_MESH

+ 1
- 1
Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp Dosyayı Görüntüle

@@ -66,7 +66,7 @@ void MeshViewerClass::Draw() {
66 66
     }
67 67
   }
68 68
   char str_1[6], str_2[6] = "";
69
-  ui.status_printf_P(0, PSTR("Mesh minZ: %s, maxZ: %s"),
69
+  ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"),
70 70
     dtostrf((float)minz / 100, 1, 2, str_1),
71 71
     dtostrf((float)maxz / 100, 1, 2, str_2)
72 72
   );

+ 1
- 1
Marlin/src/lcd/extui/mks_ui/wifi_module.cpp Dosyayı Görüntüle

@@ -2018,7 +2018,7 @@ void get_wifi_commands() {
2018 2018
                 TERN_(ARC_SUPPORT, case 2 ... 3:)
2019 2019
                 TERN_(BEZIER_CURVE_SUPPORT, case 5:)
2020 2020
                 SERIAL_ECHOLNPGM(STR_ERR_STOPPED);
2021
-                LCD_MESSAGEPGM(MSG_STOPPED);
2021
+                LCD_MESSAGE(MSG_STOPPED);
2022 2022
                 break;
2023 2023
             }
2024 2024
           }

+ 33
- 32
Marlin/src/lcd/marlinui.cpp Dosyayı Görüntüle

@@ -665,7 +665,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
665 665
 
666 666
   void MarlinUI::kill_screen(PGM_P lcd_error, PGM_P lcd_component) {
667 667
     init();
668
-    status_printf_P(1, PSTR(S_FMT ": " S_FMT), lcd_error, lcd_component);
668
+    status_printf(1, F(S_FMT ": " S_FMT), lcd_error, lcd_component);
669 669
     TERN_(HAS_LCD_MENU, return_to_status());
670 670
 
671 671
     // RED ALERT. RED ALERT.
@@ -1393,76 +1393,77 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1393 1393
     #if SERVICE_INTERVAL_3 > 0
1394 1394
       static PGMSTR(service3, "> " SERVICE_NAME_3 "!");
1395 1395
     #endif
1396
-    PGM_P msg;
1396
+    FSTR_P msg;
1397 1397
     if (printingIsPaused())
1398
-      msg = GET_TEXT(MSG_PRINT_PAUSED);
1398
+      msg = GET_TEXT_F(MSG_PRINT_PAUSED);
1399 1399
     #if ENABLED(SDSUPPORT)
1400 1400
       else if (IS_SD_PRINTING())
1401 1401
         return set_status(card.longest_filename(), true);
1402 1402
     #endif
1403 1403
     else if (print_job_timer.isRunning())
1404
-      msg = GET_TEXT(MSG_PRINTING);
1404
+      msg = GET_TEXT_F(MSG_PRINTING);
1405 1405
 
1406 1406
     #if SERVICE_INTERVAL_1 > 0
1407
-      else if (print_job_timer.needsService(1)) msg = service1;
1407
+      else if (print_job_timer.needsService(1)) msg = FPSTR(service1);
1408 1408
     #endif
1409 1409
     #if SERVICE_INTERVAL_2 > 0
1410
-      else if (print_job_timer.needsService(2)) msg = service2;
1410
+      else if (print_job_timer.needsService(2)) msg = FPSTR(service2);
1411 1411
     #endif
1412 1412
     #if SERVICE_INTERVAL_3 > 0
1413
-      else if (print_job_timer.needsService(3)) msg = service3;
1413
+      else if (print_job_timer.needsService(3)) msg = FPSTR(service3);
1414 1414
     #endif
1415 1415
 
1416 1416
     else if (!no_welcome)
1417
-      msg = GET_TEXT(WELCOME_MSG);
1417
+      msg = GET_TEXT_F(WELCOME_MSG);
1418 1418
     else
1419 1419
       return;
1420 1420
 
1421
-    set_status_P(msg, -1);
1421
+    set_status(msg, -1);
1422 1422
   }
1423 1423
 
1424
-  void MarlinUI::set_status_P(PGM_P const message, int8_t level) {
1424
+  void MarlinUI::set_status(FSTR_P const fstr, int8_t level) {
1425
+    PGM_P const pstr = FTOP(fstr);
1425 1426
     if (level < 0) level = alert_level = 0;
1426 1427
     if (level < alert_level) return;
1427 1428
     alert_level = level;
1428 1429
 
1429
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify_P(message));
1430
+    TERN_(HOST_PROMPT_SUPPORT, host_action_notify_P(pstr));
1430 1431
 
1431 1432
     // Since the message is encoded in UTF8 it must
1432 1433
     // only be cut on a character boundary.
1433 1434
 
1434 1435
     // Get a pointer to the null terminator
1435
-    PGM_P pend = message + strlen_P(message);
1436
+    PGM_P pend = pstr + strlen_P(pstr);
1436 1437
 
1437 1438
     // If length of supplied UTF8 string is greater than
1438 1439
     // the buffer size, start cutting whole UTF8 chars
1439
-    while ((pend - message) > MAX_MESSAGE_LENGTH) {
1440
+    while ((pend - pstr) > MAX_MESSAGE_LENGTH) {
1440 1441
       --pend;
1441 1442
       while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend;
1442 1443
     };
1443 1444
 
1444 1445
     // At this point, we have the proper cut point. Use it
1445
-    uint8_t maxLen = pend - message;
1446
-    strncpy_P(status_message, message, maxLen);
1446
+    uint8_t maxLen = pend - pstr;
1447
+    strncpy_P(status_message, pstr, maxLen);
1447 1448
     status_message[maxLen] = '\0';
1448 1449
 
1449 1450
     finish_status(level > 0);
1450 1451
   }
1451 1452
 
1452
-  void MarlinUI::set_alert_status_P(PGM_P const message) {
1453
-    set_status_P(message, 1);
1453
+  void MarlinUI::set_alert_status(FSTR_P const fstr) {
1454
+    set_status(fstr, 1);
1454 1455
     TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
1455 1456
     TERN_(HAS_LCD_MENU, return_to_status());
1456 1457
   }
1457 1458
 
1458 1459
   #include <stdarg.h>
1459 1460
 
1460
-  void MarlinUI::status_printf_P(const uint8_t level, PGM_P const fmt, ...) {
1461
+  void MarlinUI::status_printf(const uint8_t level, FSTR_P const fmt, ...) {
1461 1462
     if (level < alert_level) return;
1462 1463
     alert_level = level;
1463 1464
     va_list args;
1464
-    va_start(args, fmt);
1465
-    vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, fmt, args);
1465
+    va_start(args, FTOP(fmt));
1466
+    vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, FTOP(fmt), args);
1466 1467
     va_end(args);
1467 1468
     finish_status(level > 0);
1468 1469
   }
@@ -1536,7 +1537,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1536 1537
     #endif
1537 1538
     IF_DISABLED(SDSUPPORT, print_job_timer.stop());
1538 1539
     TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR));
1539
-    LCD_MESSAGEPGM(MSG_PRINT_ABORTED);
1540
+    LCD_MESSAGE(MSG_PRINT_ABORTED);
1540 1541
     TERN_(HAS_LCD_MENU, return_to_status());
1541 1542
   }
1542 1543
 
@@ -1548,7 +1549,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1548 1549
   #endif
1549 1550
 
1550 1551
   void MarlinUI::flow_fault() {
1551
-    LCD_ALERTMESSAGEPGM(MSG_FLOWMETER_FAULT);
1552
+    LCD_ALERTMESSAGE(MSG_FLOWMETER_FAULT);
1552 1553
     TERN_(HAS_BUZZER, buzz(1000, 440));
1553 1554
     TERN_(HAS_LCD_MENU, return_to_status());
1554 1555
   }
@@ -1566,7 +1567,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1566 1567
     TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
1567 1568
     TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")));
1568 1569
 
1569
-    LCD_MESSAGEPGM(MSG_PRINT_PAUSED);
1570
+    LCD_MESSAGE(MSG_PRINT_PAUSED);
1570 1571
 
1571 1572
     #if ENABLED(PARK_HEAD_ON_PAUSE)
1572 1573
       pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress
@@ -1637,14 +1638,14 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1637 1638
   //
1638 1639
   // Send the status line as a host notification
1639 1640
   //
1640
-  void MarlinUI::set_status(const char * const message, const bool) {
1641
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(message), UNUSED(message));
1641
+  void MarlinUI::set_status(const char * const cstr, const bool) {
1642
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify(cstr), UNUSED(cstr));
1642 1643
   }
1643
-  void MarlinUI::set_status_P(PGM_P message, const int8_t) {
1644
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message));
1644
+  void MarlinUI::set_status(FSTR_P const fstr, const int8_t) {
1645
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(FTOP(fstr)), UNUSED(fstr));
1645 1646
   }
1646
-  void MarlinUI::status_printf_P(const uint8_t, PGM_P const message, ...) {
1647
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message));
1647
+  void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) {
1648
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(FPSTR(fstr)), UNUSED(fstr));
1648 1649
   }
1649 1650
 
1650 1651
 #endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE
@@ -1670,7 +1671,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1670 1671
           quick_feedback();
1671 1672
           goto_screen(MEDIA_MENU_GATEWAY);
1672 1673
         #else
1673
-          LCD_MESSAGEPGM(MSG_MEDIA_INSERTED);
1674
+          LCD_MESSAGE(MSG_MEDIA_INSERTED);
1674 1675
         #endif
1675 1676
       }
1676 1677
     }
@@ -1679,7 +1680,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1679 1680
         #if ENABLED(EXTENSIBLE_UI)
1680 1681
           ExtUI::onMediaRemoved();
1681 1682
         #elif PIN_EXISTS(SD_DETECT)
1682
-          LCD_MESSAGEPGM(MSG_MEDIA_REMOVED);
1683
+          LCD_MESSAGE(MSG_MEDIA_REMOVED);
1683 1684
           #if HAS_LCD_MENU
1684 1685
             if (!defer_return_to_status) return_to_status();
1685 1686
           #endif
@@ -1802,7 +1803,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1802 1803
           );
1803 1804
         });
1804 1805
       #else
1805
-        set_status_P(eeprom_err(msgid));
1806
+        set_status(FPSTR(eeprom_err(msgid)));
1806 1807
       #endif
1807 1808
     }
1808 1809
 

+ 10
- 13
Marlin/src/lcd/marlinui.h Dosyayı Görüntüle

@@ -342,21 +342,19 @@ public:
342 342
 
343 343
     static bool has_status();
344 344
     static void reset_status(const bool no_welcome=false);
345
-    static void set_status(const char * const message, const bool persist=false);
346
-    static void set_status_P(PGM_P const message, const int8_t level=0);
347
-    static void status_printf_P(const uint8_t level, PGM_P const fmt, ...);
348
-    static void set_alert_status_P(PGM_P const message);
345
+    static void set_alert_status(FSTR_P const fstr);
349 346
     static inline void reset_alert_level() { alert_level = 0; }
350 347
   #else
351 348
     static constexpr bool has_status() { return false; }
352 349
     static inline void reset_status(const bool=false) {}
353
-    static void set_status(const char *message, const bool=false);
354
-    static void set_status_P(PGM_P message, const int8_t=0);
355
-    static void status_printf_P(const uint8_t, PGM_P message, ...);
356
-    static inline void set_alert_status_P(PGM_P const) {}
350
+    static inline void set_alert_status(FSTR_P const) {}
357 351
     static inline void reset_alert_level() {}
358 352
   #endif
359 353
 
354
+  static void set_status(const char * const cstr, const bool persist=false);
355
+  static void set_status(FSTR_P const fstr, const int8_t level=0);
356
+  static void status_printf(const uint8_t level, FSTR_P const fmt, ...);
357
+
360 358
   #if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED)
361 359
     static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component);
362 360
   #else
@@ -740,8 +738,7 @@ private:
740 738
 
741 739
 extern MarlinUI ui;
742 740
 
743
-#define LCD_MESSAGEPGM_P(x)      ui.set_status_P(x)
744
-#define LCD_ALERTMESSAGEPGM_P(x) ui.set_alert_status_P(x)
745
-
746
-#define LCD_MESSAGEPGM(x)        LCD_MESSAGEPGM_P(GET_TEXT(x))
747
-#define LCD_ALERTMESSAGEPGM(x)   LCD_ALERTMESSAGEPGM_P(GET_TEXT(x))
741
+#define LCD_MESSAGE_F(S)       ui.set_status(F(S))
742
+#define LCD_MESSAGE(M)         ui.set_status(GET_TEXT_F(M))
743
+#define LCD_ALERTMESSAGE_F(S)  ui.set_alert_status(F(S))
744
+#define LCD_ALERTMESSAGE(M)    ui.set_alert_status(GET_TEXT_F(M))

+ 1
- 1
Marlin/src/lcd/menu/menu_advanced.cpp Dosyayı Görüntüle

@@ -630,7 +630,7 @@ void menu_advanced_settings() {
630 630
                  didset = settings.set_sd_update_status(new_state);
631 631
       ui.completion_feedback(didset);
632 632
       ui.return_to_status();
633
-      if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status();
633
+      if (new_state) LCD_MESSAGE(MSG_RESET_PRINTER); else ui.reset_status();
634 634
     });
635 635
   #endif
636 636
 

+ 1
- 1
Marlin/src/lcd/menu/menu_mixer.cpp Dosyayı Görüntüle

@@ -253,7 +253,7 @@ void menu_mixer() {
253 253
     MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
254 254
     []{
255 255
       mixer.reset_vtools();
256
-      LCD_MESSAGEPGM(MSG_VTOOLS_RESET);
256
+      LCD_MESSAGE(MSG_VTOOLS_RESET);
257 257
       ui.return_to_status();
258 258
     },
259 259
     nullptr,

+ 4
- 4
Marlin/src/lcd/menu/menu_mmu2.cpp Dosyayı Görüntüle

@@ -36,14 +36,14 @@
36 36
 inline void action_mmu2_load_filament_to_nozzle(const uint8_t tool) {
37 37
   ui.reset_status();
38 38
   ui.return_to_status();
39
-  ui.status_printf_P(0,  GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(tool + 1));
39
+  ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(tool + 1));
40 40
   if (mmu2.load_filament_to_nozzle(tool)) ui.reset_status();
41 41
   ui.return_to_status();
42 42
 }
43 43
 
44 44
 void _mmu2_load_filament(uint8_t index) {
45 45
   ui.return_to_status();
46
-  ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
46
+  ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
47 47
   mmu2.load_filament(index);
48 48
   ui.reset_status();
49 49
 }
@@ -74,14 +74,14 @@ void menu_mmu2_load_to_nozzle() {
74 74
 void _mmu2_eject_filament(uint8_t index) {
75 75
   ui.reset_status();
76 76
   ui.return_to_status();
77
-  ui.status_printf_P(0, GET_TEXT(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
77
+  ui.status_printf(0, GET_TEXT_F(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
78 78
   if (mmu2.eject_filament(index, true)) ui.reset_status();
79 79
 }
80 80
 
81 81
 void action_mmu2_unload_filament() {
82 82
   ui.reset_status();
83 83
   ui.return_to_status();
84
-  LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT);
84
+  LCD_MESSAGE(MSG_MMU2_UNLOADING_FILAMENT);
85 85
   idle();
86 86
   if (mmu2.unload()) ui.reset_status();
87 87
 }

+ 2
- 2
Marlin/src/module/endstops.cpp Dosyayı Görüntüle

@@ -460,8 +460,8 @@ void Endstops::event_handler() {
460 460
     SERIAL_EOL();
461 461
 
462 462
     TERN_(HAS_STATUS_MESSAGE,
463
-      ui.status_printf_P(0,
464
-        PSTR(S_FMT GANG_N_1(LINEAR_AXES, " %c") " %c"),
463
+      ui.status_printf(0,
464
+        F(S_FMT GANG_N_1(LINEAR_AXES, " %c") " %c"),
465 465
         GET_TEXT(MSG_LCD_ENDSTOPS),
466 466
         LINEAR_AXIS_LIST(chrX, chrY, chrZ, chrI, chrJ, chrK), chrP
467 467
       )

+ 6
- 6
Marlin/src/module/probe.cpp Dosyayı Görüntüle

@@ -137,7 +137,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
137 137
     #if ENABLED(TOUCH_MI_MANUAL_DEPLOY)
138 138
 
139 139
       const screenFunc_t prev_screen = ui.currentScreen;
140
-      LCD_MESSAGEPGM(MSG_MANUAL_DEPLOY_TOUCHMI);
140
+      LCD_MESSAGE(MSG_MANUAL_DEPLOY_TOUCHMI);
141 141
       ui.return_to_status();
142 142
 
143 143
       TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR));
@@ -290,10 +290,10 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
290 290
       BUZZ(100, 659);
291 291
       BUZZ(100, 698);
292 292
 
293
-      PGM_P const ds_str = deploy ? GET_TEXT(MSG_MANUAL_DEPLOY) : GET_TEXT(MSG_MANUAL_STOW);
293
+      FSTR_P const ds_str = deploy ? GET_TEXT_F(MSG_MANUAL_DEPLOY) : GET_TEXT_F(MSG_MANUAL_STOW);
294 294
       ui.return_to_status();       // To display the new status message
295
-      ui.set_status_P(ds_str, 99);
296
-      SERIAL_ECHOLNPGM_P(ds_str);
295
+      ui.set_status(ds_str, 99);
296
+      SERIAL_ECHOLNF(ds_str);
297 297
 
298 298
       TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR));
299 299
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe")));
@@ -439,7 +439,7 @@ bool Probe::set_deployed(const bool deploy) {
439 439
     if (PROBE_TRIGGERED() == deploy) {             // Unchanged after deploy/stow action?
440 440
       if (IsRunning()) {
441 441
         SERIAL_ERROR_MSG("Z-Probe failed");
442
-        LCD_ALERTMESSAGEPGM_P(PSTR("Err: ZPROBE"));
442
+        LCD_ALERTMESSAGE_F("Err: ZPROBE");
443 443
       }
444 444
       stop();
445 445
       return true;
@@ -793,7 +793,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
793 793
 
794 794
   if (isnan(measured_z)) {
795 795
     stow();
796
-    LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED);
796
+    LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
797 797
     #if DISABLED(G29_RETRY_AND_RECOVER)
798 798
       SERIAL_ERROR_MSG(STR_ERR_PROBING_FAILED);
799 799
     #endif

+ 3
- 3
Marlin/src/module/settings.cpp Dosyayı Görüntüle

@@ -1471,7 +1471,7 @@ void MarlinSettings::postprocess() {
1471 1471
         store_mesh(ubl.storage_slot);
1472 1472
     #endif
1473 1473
 
1474
-    if (!eeprom_error) LCD_MESSAGEPGM(MSG_SETTINGS_STORED);
1474
+    if (!eeprom_error) LCD_MESSAGE(MSG_SETTINGS_STORED);
1475 1475
 
1476 1476
     TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error));
1477 1477
 
@@ -1497,7 +1497,7 @@ void MarlinSettings::postprocess() {
1497 1497
         stored_ver[1] = '\0';
1498 1498
       }
1499 1499
       DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1500
-      TERN_(DWIN_CREALITY_LCD_ENHANCED, ui.set_status(GET_TEXT(MSG_ERR_EEPROM_VERSION)));
1500
+      TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION));
1501 1501
 
1502 1502
       IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version());
1503 1503
       eeprom_error = true;
@@ -2362,7 +2362,7 @@ void MarlinSettings::postprocess() {
2362 2362
       else if (working_crc != stored_crc) {
2363 2363
         eeprom_error = true;
2364 2364
         DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2365
-        TERN_(DWIN_CREALITY_LCD_ENHANCED, ui.set_status(GET_TEXT(MSG_ERR_EEPROM_CRC)));
2365
+        TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_CRC));
2366 2366
         IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc());
2367 2367
       }
2368 2368
       else if (!validating) {

+ 7
- 7
Marlin/src/module/temperature.cpp Dosyayı Görüntüle

@@ -635,7 +635,7 @@ volatile bool Temperature::raw_temps_ready = false;
635 635
 
636 636
     // PID Tuning loop
637 637
     wait_for_heatup = true; // Can be interrupted with M108
638
-    TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT), "Wait for heat up..."));
638
+    TERN_(HAS_STATUS_MESSAGE, ui.set_status(F("Wait for heat up...")));
639 639
     while (wait_for_heatup) {
640 640
 
641 641
       const millis_t ms = millis();
@@ -696,7 +696,7 @@ volatile bool Temperature::raw_temps_ready = false;
696 696
             }
697 697
           }
698 698
           SHV((bias + d) >> 1);
699
-          TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PID_CYCLE), cycles, ncycles));
699
+          TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PID_CYCLE), cycles, ncycles));
700 700
           cycles++;
701 701
           minT = target;
702 702
         }
@@ -3603,11 +3603,11 @@ void Temperature::isr() {
3603 3603
   #if HAS_HOTEND && HAS_STATUS_MESSAGE
3604 3604
     void Temperature::set_heating_message(const uint8_t e) {
3605 3605
       const bool heating = isHeatingHotend(e);
3606
-      ui.status_printf_P(0,
3606
+      ui.status_printf(0,
3607 3607
         #if HAS_MULTI_HOTEND
3608
-          PSTR("E%c " S_FMT), '1' + e
3608
+          F("E%c " S_FMT), '1' + e
3609 3609
         #else
3610
-          PSTR("E1 " S_FMT)
3610
+          F("E1 " S_FMT)
3611 3611
         #endif
3612 3612
         , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING)
3613 3613
       );
@@ -3744,7 +3744,7 @@ void Temperature::isr() {
3744 3744
       void Temperature::wait_for_hotend_heating(const uint8_t target_extruder) {
3745 3745
         if (isHeatingHotend(target_extruder)) {
3746 3746
           SERIAL_ECHOLNPGM("Wait for hotend heating...");
3747
-          LCD_MESSAGEPGM(MSG_HEATING);
3747
+          LCD_MESSAGE(MSG_HEATING);
3748 3748
           wait_for_hotend(target_extruder);
3749 3749
           ui.reset_status();
3750 3750
         }
@@ -3874,7 +3874,7 @@ void Temperature::isr() {
3874 3874
     void Temperature::wait_for_bed_heating() {
3875 3875
       if (isHeatingBed()) {
3876 3876
         SERIAL_ECHOLNPGM("Wait for bed heating...");
3877
-        LCD_MESSAGEPGM(MSG_BED_HEATING);
3877
+        LCD_MESSAGE(MSG_BED_HEATING);
3878 3878
         wait_for_bed();
3879 3879
         ui.reset_status();
3880 3880
       }

+ 2
- 2
Marlin/src/module/tool_change.cpp Dosyayı Görüntüle

@@ -490,12 +490,12 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
490 490
       #endif
491 491
 
492 492
       if (check_tool_sensor_stats(0)) {
493
-        ui.set_status_P("TC error");
493
+        LCD_MESSAGE_F("TC error");
494 494
         switching_toolhead_lock(false);
495 495
         while (check_tool_sensor_stats(0)) { /* nada */ }
496 496
         switching_toolhead_lock(true);
497 497
       }
498
-      ui.set_status_P("TC Success");
498
+      LCD_MESSAGE_F("TC Success");
499 499
     #endif
500 500
   }
501 501
 

+ 1
- 1
Marlin/src/sd/cardreader.cpp Dosyayı Görüntüle

@@ -457,7 +457,7 @@ void CardReader::mount() {
457 457
     cdroot();
458 458
   #if ENABLED(USB_FLASH_DRIVE_SUPPORT) || PIN_EXISTS(SD_DETECT)
459 459
     else if (marlin_state != MF_INITIALIZING)
460
-      ui.set_status_P(GET_TEXT(MSG_SD_INIT_FAIL), -1);
460
+      ui.set_status(GET_TEXT_F(MSG_SD_INIT_FAIL), -1);
461 461
   #endif
462 462
 
463 463
   ui.refresh();

+ 5
- 5
Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp Dosyayı Görüntüle

@@ -126,7 +126,7 @@ bool DiskIODriver_USBFlash::usbStartup() {
126 126
     SERIAL_ECHOPGM("Starting USB host...");
127 127
     if (!UHS_START) {
128 128
       SERIAL_ECHOLNPGM(" failed.");
129
-      LCD_MESSAGEPGM(MSG_MEDIA_USB_FAILED);
129
+      LCD_MESSAGE(MSG_MEDIA_USB_FAILED);
130 130
       return false;
131 131
     }
132 132
 
@@ -221,7 +221,7 @@ void DiskIODriver_USBFlash::idle() {
221 221
           #if USB_DEBUG >= 1
222 222
             SERIAL_ECHOLNPGM("Waiting for media");
223 223
           #endif
224
-          LCD_MESSAGEPGM(MSG_MEDIA_WAITING);
224
+          LCD_MESSAGE(MSG_MEDIA_WAITING);
225 225
           GOTO_STATE_AFTER_DELAY(state, 2000);
226 226
         }
227 227
         break;
@@ -236,7 +236,7 @@ void DiskIODriver_USBFlash::idle() {
236 236
         SERIAL_ECHOLNPGM("USB device removed");
237 237
       #endif
238 238
       if (state != MEDIA_READY)
239
-        LCD_MESSAGEPGM(MSG_MEDIA_USB_REMOVED);
239
+        LCD_MESSAGE(MSG_MEDIA_USB_REMOVED);
240 240
       GOTO_STATE_AFTER_DELAY(WAIT_FOR_DEVICE, 0);
241 241
     }
242 242
 
@@ -245,12 +245,12 @@ void DiskIODriver_USBFlash::idle() {
245 245
       #if USB_DEBUG >= 1
246 246
         SERIAL_ECHOLNPGM("Media removed");
247 247
       #endif
248
-      LCD_MESSAGEPGM(MSG_MEDIA_REMOVED);
248
+      LCD_MESSAGE(MSG_MEDIA_REMOVED);
249 249
       GOTO_STATE_AFTER_DELAY(WAIT_FOR_DEVICE, 0);
250 250
     }
251 251
 
252 252
     else if (task_state == UHS_STATE(ERROR)) {
253
-      LCD_MESSAGEPGM(MSG_MEDIA_READ_ERROR);
253
+      LCD_MESSAGE(MSG_MEDIA_READ_ERROR);
254 254
       GOTO_STATE_AFTER_DELAY(MEDIA_ERROR, 0);
255 255
     }
256 256
   }

Loading…
İptal
Kaydet