Parcourir la source

🏗️ Axis name arrays

Co-Authored-By: DerAndere <26200979+DerAndere1@users.noreply.github.com>
Scott Lahteine il y a 3 ans
Parent
révision
877e10205b

+ 1
- 1
Marlin/src/HAL/AVR/pinsDebug.h Voir le fichier

74
 #define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
74
 #define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
75
 
75
 
76
 void PRINT_ARRAY_NAME(uint8_t x) {
76
 void PRINT_ARRAY_NAME(uint8_t x) {
77
-  char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
77
+  char *name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
78
   LOOP_L_N(y, MAX_NAME_LENGTH) {
78
   LOOP_L_N(y, MAX_NAME_LENGTH) {
79
     char temp_char = pgm_read_byte(name_mem_pointer + y);
79
     char temp_char = pgm_read_byte(name_mem_pointer + y);
80
     if (temp_char != 0)
80
     if (temp_char != 0)

+ 3
- 0
Marlin/src/core/serial.h Voir le fichier

36
                   X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], U_STR[], V_STR[], W_STR[], E_STR[],
36
                   X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], U_STR[], V_STR[], W_STR[], E_STR[],
37
                   X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], U_LBL[], V_LBL[], W_LBL[], E_LBL[];
37
                   X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], U_LBL[], V_LBL[], W_LBL[], E_LBL[];
38
 
38
 
39
+PGM_P const SP_AXIS_LBL[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_LBL, SP_X_LBL, SP_Y_LBL, SP_Z_LBL, SP_I_LBL, SP_J_LBL, SP_K_LBL, SP_U_LBL, SP_V_LBL, SP_W_LBL);
40
+PGM_P const SP_AXIS_STR[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_STR, SP_X_STR, SP_Y_STR, SP_Z_STR, SP_I_STR, SP_J_STR, SP_K_STR, SP_U_STR, SP_V_STR, SP_W_STR);
41
+
39
 //
42
 //
40
 // Debugging flags for use by M111
43
 // Debugging flags for use by M111
41
 //
44
 //

+ 1
- 1
Marlin/src/core/utility.cpp Voir le fichier

126
         #if ABL_PLANAR
126
         #if ABL_PLANAR
127
           SERIAL_ECHOPGM("ABL Adjustment");
127
           SERIAL_ECHOPGM("ABL Adjustment");
128
           LOOP_NUM_AXES(a) {
128
           LOOP_NUM_AXES(a) {
129
-            SERIAL_CHAR(' ', AXIS_CHAR(a));
129
+            SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
130
             serial_offset(planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]);
130
             serial_offset(planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]);
131
           }
131
           }
132
         #else
132
         #else

+ 2
- 5
Marlin/src/gcode/calibrate/M425.cpp Voir le fichier

92
     SERIAL_ECHOLNPGM("  Correction Amount/Fade-out:     F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
92
     SERIAL_ECHOLNPGM("  Correction Amount/Fade-out:     F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
93
     SERIAL_ECHOPGM("  Backlash Distance (mm):        ");
93
     SERIAL_ECHOPGM("  Backlash Distance (mm):        ");
94
     LOOP_NUM_AXES(a) if (axis_can_calibrate(a)) {
94
     LOOP_NUM_AXES(a) if (axis_can_calibrate(a)) {
95
-      SERIAL_CHAR(' ', AXIS_CHAR(a));
96
-      SERIAL_ECHO(backlash.get_distance_mm(AxisEnum(a)));
97
-      SERIAL_EOL();
95
+      SERIAL_ECHOLNPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]), backlash.get_distance_mm((AxisEnum)a));
98
     }
96
     }
99
 
97
 
100
     #ifdef BACKLASH_SMOOTHING_MM
98
     #ifdef BACKLASH_SMOOTHING_MM
105
       SERIAL_ECHOPGM("  Average measured backlash (mm):");
103
       SERIAL_ECHOPGM("  Average measured backlash (mm):");
106
       if (backlash.has_any_measurement()) {
104
       if (backlash.has_any_measurement()) {
107
         LOOP_NUM_AXES(a) if (axis_can_calibrate(a) && backlash.has_measurement(AxisEnum(a))) {
105
         LOOP_NUM_AXES(a) if (axis_can_calibrate(a) && backlash.has_measurement(AxisEnum(a))) {
108
-          SERIAL_CHAR(' ', AXIS_CHAR(a));
109
-          SERIAL_ECHO(backlash.get_measurement(AxisEnum(a)));
106
+          SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]), backlash.get_measurement((AxisEnum)a));
110
         }
107
         }
111
       }
108
       }
112
       else
109
       else

+ 1
- 1
Marlin/src/gcode/control/M111.cpp Voir le fichier

49
     LOOP_L_N(i, COUNT(debug_strings)) {
49
     LOOP_L_N(i, COUNT(debug_strings)) {
50
       if (TEST(marlin_debug_flags, i)) {
50
       if (TEST(marlin_debug_flags, i)) {
51
         if (comma++) SERIAL_CHAR(',');
51
         if (comma++) SERIAL_CHAR(',');
52
-        SERIAL_ECHOPGM_P((char*)pgm_read_ptr(&debug_strings[i]));
52
+        SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&debug_strings[i]));
53
       }
53
       }
54
     }
54
     }
55
   }
55
   }

+ 1
- 1
Marlin/src/gcode/control/M17_M18_M84.cpp Voir le fichier

184
 
184
 
185
   auto overlap_warning = [](const ena_mask_t axis_bits) {
185
   auto overlap_warning = [](const ena_mask_t axis_bits) {
186
     SERIAL_ECHOPGM(" not disabled. Shared with");
186
     SERIAL_ECHOPGM(" not disabled. Shared with");
187
-    LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_CHAR(' ', axis_codes[a]);
187
+    LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
188
     #if HAS_EXTRUDERS
188
     #if HAS_EXTRUDERS
189
       #define _EN_STILLON(N) if (TEST(axis_bits, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR(' ', 'E', '0' + N);
189
       #define _EN_STILLON(N) if (TEST(axis_bits, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR(' ', 'E', '0' + N);
190
       REPEAT(EXTRUDERS, _EN_STILLON)
190
       REPEAT(EXTRUDERS, _EN_STILLON)

+ 3
- 7
Marlin/src/gcode/host/M114.cpp Voir le fichier

37
   void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
37
   void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
38
     char str[12];
38
     char str[12];
39
     LOOP_L_N(a, n) {
39
     LOOP_L_N(a, n) {
40
-      SERIAL_CHAR(' ', axis_codes[a], ':');
40
+      SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
41
       if (pos[a] >= 0) SERIAL_CHAR(' ');
41
       if (pos[a] >= 0) SERIAL_CHAR(' ');
42
       SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
42
       SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
43
     }
43
     }
47
 
47
 
48
   void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
48
   void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
49
     char str[12];
49
     char str[12];
50
-    LOOP_NUM_AXES(a) {
51
-      SERIAL_CHAR(' ', AXIS_CHAR(a), ':');
52
-      SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
53
-    }
50
+    LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str));
54
     SERIAL_EOL();
51
     SERIAL_EOL();
55
   }
52
   }
56
 
53
 
172
 
169
 
173
     SERIAL_ECHOPGM("Stepper:");
170
     SERIAL_ECHOPGM("Stepper:");
174
     LOOP_LOGICAL_AXES(i) {
171
     LOOP_LOGICAL_AXES(i) {
175
-      SERIAL_CHAR(' ', axis_codes[i], ':');
176
-      SERIAL_ECHO(stepper.position((AxisEnum)i));
172
+      SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[i]), stepper.position((AxisEnum)i));
177
     }
173
     }
178
     SERIAL_EOL();
174
     SERIAL_EOL();
179
 
175
 

+ 1
- 1
Marlin/src/lcd/menu/menu_tramming.cpp Voir le fichier

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((char*)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
86
+    SUBMENU_P((PGM_P)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

Chargement…
Annuler
Enregistrer