Przeglądaj źródła

Use PSTR for common labels

Scott Lahteine 4 lat temu
rodzic
commit
5e9a10dbae

+ 9
- 1
Marlin/src/MarlinCore.cpp Wyświetl plik

192
            SP_X_STR[] PROGMEM = " X",
192
            SP_X_STR[] PROGMEM = " X",
193
            SP_Y_STR[] PROGMEM = " Y",
193
            SP_Y_STR[] PROGMEM = " Y",
194
            SP_Z_STR[] PROGMEM = " Z",
194
            SP_Z_STR[] PROGMEM = " Z",
195
-           SP_E_STR[] PROGMEM = " E";
195
+           SP_E_STR[] PROGMEM = " E",
196
+              X_LBL[] PROGMEM =  "X:",
197
+              Y_LBL[] PROGMEM =  "Y:",
198
+              Z_LBL[] PROGMEM =  "Z:",
199
+              E_LBL[] PROGMEM =  "E:",
200
+           SP_X_LBL[] PROGMEM = " X:",
201
+           SP_Y_LBL[] PROGMEM = " Y:",
202
+           SP_Z_LBL[] PROGMEM = " Z:",
203
+           SP_E_LBL[] PROGMEM = " E:";
196
 
204
 
197
 bool Running = true;
205
 bool Running = true;
198
 
206
 

+ 3
- 1
Marlin/src/MarlinCore.h Wyświetl plik

123
 #endif
123
 #endif
124
 
124
 
125
 extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
125
 extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
126
-                  SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[];
126
+                  SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
127
+                  X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];
128
+

+ 5
- 5
Marlin/src/feature/dac/stepper_dac.cpp Wyświetl plik

88
 
88
 
89
   SERIAL_ECHO_MSG("Stepper current values in % (Amps):");
89
   SERIAL_ECHO_MSG("Stepper current values in % (Amps):");
90
   SERIAL_ECHO_START();
90
   SERIAL_ECHO_START();
91
-  SERIAL_ECHOLNPAIR(
92
-    " X:", dac_perc(X_AXIS), " (", dac_amps(X_AXIS), ")"
93
-    " Y:", dac_perc(Y_AXIS), " (", dac_amps(Y_AXIS), ")"
94
-    " Z:", dac_perc(Z_AXIS), " (", dac_amps(Z_AXIS), ")"
95
-    " E:", dac_perc(E_AXIS), " (", dac_amps(E_AXIS), ")"
91
+  SERIAL_ECHOLNPAIR_P(
92
+    SP_X_LBL, dac_perc(X_AXIS), PSTR(" ("), dac_amps(X_AXIS), PSTR(")")
93
+    SP_Y_LBL, dac_perc(Y_AXIS), PSTR(" ("), dac_amps(Y_AXIS), PSTR(")")
94
+    SP_Z_LBL, dac_perc(Z_AXIS), PSTR(" ("), dac_amps(Z_AXIS), PSTR(")")
95
+    SP_E_LBL, dac_perc(E_AXIS), PSTR(" ("), dac_amps(E_AXIS), PSTR(")")
96
   );
96
   );
97
 }
97
 }
98
 
98
 

+ 4
- 4
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Wyświetl plik

1212
         #define _LCD_W_POS 12
1212
         #define _LCD_W_POS 12
1213
         #define _PLOT_X 1
1213
         #define _PLOT_X 1
1214
         #define _MAP_X 3
1214
         #define _MAP_X 3
1215
-        #define _LABEL(C,X,Y) lcd_put_u8str(X, Y, C)
1216
-        #define _XLABEL(X,Y) _LABEL("X:",X,Y)
1217
-        #define _YLABEL(X,Y) _LABEL("Y:",X,Y)
1218
-        #define _ZLABEL(X,Y) _LABEL("Z:",X,Y)
1215
+        #define _LABEL(C,X,Y) lcd_put_u8str_P(X, Y, C)
1216
+        #define _XLABEL(X,Y) _LABEL(X_LBL,X,Y)
1217
+        #define _YLABEL(X,Y) _LABEL(Y_LBL,X,Y)
1218
+        #define _ZLABEL(X,Y) _LABEL(Z_LBL,X,Y)
1219
       #else
1219
       #else
1220
         #define _LCD_W_POS 8
1220
         #define _LCD_W_POS 8
1221
         #define _PLOT_X 0
1221
         #define _PLOT_X 0

+ 2
- 2
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Wyświetl plik

652
           }
652
           }
653
         }
653
         }
654
         else if (progress_state == 2 && estimation_string[0]) {
654
         else if (progress_state == 2 && estimation_string[0]) {
655
-          lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, "R:");
655
+          lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, PSTR("R:"));
656
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
656
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
657
         }
657
         }
658
         else if (elapsed_string[0]) {
658
         else if (elapsed_string[0]) {
659
-          lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, "E:");
659
+          lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL);
660
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
660
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
661
         }
661
         }
662
 
662
 

+ 3
- 3
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp Wyświetl plik

548
       if (PAGE_UNDER(7)) {
548
       if (PAGE_UNDER(7)) {
549
         const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) },
549
         const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) },
550
                        lpos = pos.asLogical();
550
                        lpos = pos.asLogical();
551
-        lcd_put_u8str(5, 7, "X:");
551
+        lcd_put_u8str_P(5, 7, X_LBL);
552
         lcd_put_u8str(ftostr52(lpos.x));
552
         lcd_put_u8str(ftostr52(lpos.x));
553
-        lcd_put_u8str(74, 7, "Y:");
553
+        lcd_put_u8str_P(74, 7, Y_LBL);
554
         lcd_put_u8str(ftostr52(lpos.y));
554
         lcd_put_u8str(ftostr52(lpos.y));
555
       }
555
       }
556
 
556
 
563
         lcd_put_wchar(')');
563
         lcd_put_wchar(')');
564
 
564
 
565
         // Show the location value
565
         // Show the location value
566
-        lcd_put_u8str(74, LCD_PIXEL_HEIGHT, "Z:");
566
+        lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL);
567
         if (!isnan(ubl.z_values[x_plot][y_plot]))
567
         if (!isnan(ubl.z_values[x_plot][y_plot]))
568
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
568
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
569
         else
569
         else

+ 7
- 4
Marlin/src/module/planner.cpp Wyświetl plik

2628
       SERIAL_ECHOPAIR("->", target.a);
2628
       SERIAL_ECHOPAIR("->", target.a);
2629
       SERIAL_ECHOPAIR(") B:", b);
2629
       SERIAL_ECHOPAIR(") B:", b);
2630
     #else
2630
     #else
2631
-      SERIAL_ECHOPAIR(" X:", a);
2631
+      SERIAL_ECHOPAIR_P(SP_X_LBL, a);
2632
       SERIAL_ECHOPAIR(" (", position.x);
2632
       SERIAL_ECHOPAIR(" (", position.x);
2633
       SERIAL_ECHOPAIR("->", target.x);
2633
       SERIAL_ECHOPAIR("->", target.x);
2634
-      SERIAL_ECHOPAIR(") Y:", b);
2634
+      SERIAL_CHAR(')');
2635
+      SERIAL_ECHOPAIR_P(SP_Y_LBL, b);
2635
     #endif
2636
     #endif
2636
     SERIAL_ECHOPAIR(" (", position.y);
2637
     SERIAL_ECHOPAIR(" (", position.y);
2637
     SERIAL_ECHOPAIR("->", target.y);
2638
     SERIAL_ECHOPAIR("->", target.y);
2638
     #if ENABLED(DELTA)
2639
     #if ENABLED(DELTA)
2639
       SERIAL_ECHOPAIR(") C:", c);
2640
       SERIAL_ECHOPAIR(") C:", c);
2640
     #else
2641
     #else
2641
-      SERIAL_ECHOPAIR(") Z:", c);
2642
+      SERIAL_CHAR(')');
2643
+      SERIAL_ECHOPAIR_P(SP_Z_LBL, c);
2642
     #endif
2644
     #endif
2643
     SERIAL_ECHOPAIR(" (", position.z);
2645
     SERIAL_ECHOPAIR(" (", position.z);
2644
     SERIAL_ECHOPAIR("->", target.z);
2646
     SERIAL_ECHOPAIR("->", target.z);
2645
-    SERIAL_ECHOPAIR(") E:", e);
2647
+    SERIAL_CHAR(')');
2648
+    SERIAL_ECHOPAIR_P(SP_E_LBL, e);
2646
     SERIAL_ECHOPAIR(" (", position.e);
2649
     SERIAL_ECHOPAIR(" (", position.e);
2647
     SERIAL_ECHOPAIR("->", target.e);
2650
     SERIAL_ECHOPAIR("->", target.e);
2648
     SERIAL_ECHOLNPGM(")");
2651
     SERIAL_ECHOLNPGM(")");

+ 4
- 2
Marlin/src/module/scara.cpp Wyświetl plik

53
       current_position[axis] = cartes[axis];
53
       current_position[axis] = cartes[axis];
54
     #else
54
     #else
55
       // MP_SCARA uses a Cartesian XY home position
55
       // MP_SCARA uses a Cartesian XY home position
56
-      // SERIAL_ECHOLNPAIR("homeposition X:", homeposition.x, " Y:", homeposition.y);
56
+      // SERIAL_ECHOPGM("homeposition");
57
+      // SERIAL_ECHOLNPAIR_P(SP_X_LBL, homeposition.x, SP_Y_LBL, homeposition.y);
57
       current_position[axis] = homeposition[axis];
58
       current_position[axis] = homeposition[axis];
58
     #endif
59
     #endif
59
 
60
 
60
-    // SERIAL_ECHOLNPAIR("Cartesian X:", current_position.x, " Y:", current_position.y);
61
+    // SERIAL_ECHOPGM("Cartesian");
62
+    // SERIAL_ECHOLNPAIR_P(SP_X_LBL, current_position.x, SP_Y_LBL, current_position.y);
61
     update_software_endstops(axis);
63
     update_software_endstops(axis);
62
   }
64
   }
63
 }
65
 }

+ 2
- 2
Marlin/src/module/stepper.cpp Wyświetl plik

2464
   #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA
2464
   #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA
2465
     SERIAL_ECHOPAIR(STR_COUNT_A, pos.x, " B:", pos.y);
2465
     SERIAL_ECHOPAIR(STR_COUNT_A, pos.x, " B:", pos.y);
2466
   #else
2466
   #else
2467
-    SERIAL_ECHOPAIR(STR_COUNT_X, pos.x, " Y:", pos.y);
2467
+    SERIAL_ECHOPAIR_P(PSTR(STR_COUNT_X), pos.x, SP_Y_LBL, pos.y);
2468
   #endif
2468
   #endif
2469
   #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA)
2469
   #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA)
2470
     SERIAL_ECHOLNPAIR(" C:", pos.z);
2470
     SERIAL_ECHOLNPAIR(" C:", pos.z);
2471
   #else
2471
   #else
2472
-    SERIAL_ECHOLNPAIR(" Z:", pos.z);
2472
+    SERIAL_ECHOLNPAIR_P(SP_Z_LBL, pos.z);
2473
   #endif
2473
   #endif
2474
 }
2474
 }
2475
 
2475
 

Ładowanie…
Anuluj
Zapisz