Bladeren bron

🏗️ Extend AXIS_CHAR to include E

Co-Authored-By: DerAndere <26200979+DerAndere1@users.noreply.github.com>
Scott Lahteine 2 jaren geleden
bovenliggende
commit
8b8defeacc

+ 1
- 1
Marlin/src/core/utility.h Bestand weergeven

@@ -79,7 +79,7 @@ constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127)
79 79
 
80 80
 // Axis names for G-code parsing, reports, etc.
81 81
 const xyze_char_t axis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', AXIS4_NAME, AXIS5_NAME, AXIS6_NAME, AXIS7_NAME, AXIS8_NAME, AXIS9_NAME);
82
-#if NUM_AXES <= XYZ
82
+#if NUM_AXES <= XYZ && !HAS_EXTRUDERS
83 83
   #define AXIS_CHAR(A) ((char)('X' + A))
84 84
   #define IAXIS_CHAR AXIS_CHAR
85 85
 #else

+ 22
- 22
Marlin/src/feature/encoder_i2c.cpp Bestand weergeven

@@ -49,7 +49,7 @@ void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) {
49 49
 
50 50
   initialized = true;
51 51
 
52
-  SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(axis_codes[encoderAxis]), " axis, addr = ", address);
52
+  SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis, addr = ", address);
53 53
 
54 54
   position = get_position();
55 55
 }
@@ -67,7 +67,7 @@ void I2CPositionEncoder::update() {
67 67
     /*
68 68
     if (trusted) { //commented out as part of the note below
69 69
       trusted = false;
70
-      SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(axis_codes[encoderAxis]), " axis encoder. Disengaging error correction until module is trusted again.");
70
+      SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis encoder. Disengaging error correction until module is trusted again.");
71 71
     }
72 72
     */
73 73
     return;
@@ -92,7 +92,7 @@ void I2CPositionEncoder::update() {
92 92
       if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
93 93
         trusted = true;
94 94
 
95
-        SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(axis_codes[encoderAxis]), " axis has been fault-free for set duration, reinstating error correction.");
95
+        SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis has been fault-free for set duration, reinstating error correction.");
96 96
 
97 97
         //the encoder likely lost its place when the error occurred, so we'll reset and use the printer's
98 98
         //idea of where it the axis is to re-initialize
@@ -172,7 +172,7 @@ void I2CPositionEncoder::update() {
172 172
             float sumP = 0;
173 173
             LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
174 174
             const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
175
-            SERIAL_CHAR(axis_codes[encoderAxis]);
175
+            SERIAL_CHAR(AXIS_CHAR(encoderAxis));
176 176
             SERIAL_ECHOLNPGM(" : CORRECT ERR ", errorP * planner.mm_per_step[encoderAxis], "mm");
177 177
             babystep.add_steps(encoderAxis, -LROUND(errorP));
178 178
             errPrstIdx = 0;
@@ -192,7 +192,7 @@ void I2CPositionEncoder::update() {
192 192
     if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
193 193
       const millis_t ms = millis();
194 194
       if (ELAPSED(ms, nextErrorCountTime)) {
195
-        SERIAL_CHAR(axis_codes[encoderAxis]);
195
+        SERIAL_CHAR(AXIS_CHAR(encoderAxis));
196 196
         SERIAL_ECHOLNPGM(" : LARGE ERR ", error, "; diffSum=", diffSum);
197 197
         errorCount++;
198 198
         nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
@@ -212,7 +212,7 @@ void I2CPositionEncoder::set_homed() {
212 212
     homed = trusted = true;
213 213
 
214 214
     #ifdef I2CPE_DEBUG
215
-      SERIAL_CHAR(axis_codes[encoderAxis]);
215
+      SERIAL_CHAR(AXIS_CHAR(encoderAxis));
216 216
       SERIAL_ECHOLNPGM(" axis encoder homed, offset of ", zeroOffset, " ticks.");
217 217
     #endif
218 218
   }
@@ -223,7 +223,7 @@ void I2CPositionEncoder::set_unhomed() {
223 223
   homed = trusted = false;
224 224
 
225 225
   #ifdef I2CPE_DEBUG
226
-    SERIAL_CHAR(axis_codes[encoderAxis]);
226
+    SERIAL_CHAR(AXIS_CHAR(encoderAxis));
227 227
     SERIAL_ECHOLNPGM(" axis encoder unhomed.");
228 228
   #endif
229 229
 }
@@ -231,7 +231,7 @@ void I2CPositionEncoder::set_unhomed() {
231 231
 bool I2CPositionEncoder::passes_test(const bool report) {
232 232
   if (report) {
233 233
     if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. ");
234
-    SERIAL_CHAR(axis_codes[encoderAxis]);
234
+    SERIAL_CHAR(AXIS_CHAR(encoderAxis));
235 235
     serial_ternary(H == I2CPE_MAG_SIG_BAD, F(" axis "), F("magnetic strip "), F("encoder "));
236 236
     switch (H) {
237 237
       case I2CPE_MAG_SIG_GOOD:
@@ -252,7 +252,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
252 252
               error = ABS(diff) > 10000 ? 0 : diff; // Huge error is a bad reading
253 253
 
254 254
   if (report) {
255
-    SERIAL_CHAR(axis_codes[encoderAxis]);
255
+    SERIAL_CHAR(AXIS_CHAR(encoderAxis));
256 256
     SERIAL_ECHOLNPGM(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
257 257
   }
258 258
 
@@ -262,7 +262,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
262 262
 int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
263 263
   if (!active) {
264 264
     if (report) {
265
-      SERIAL_CHAR(axis_codes[encoderAxis]);
265
+      SERIAL_CHAR(AXIS_CHAR(encoderAxis));
266 266
       SERIAL_ECHOLNPGM(" axis encoder not active!");
267 267
     }
268 268
     return 0;
@@ -287,7 +287,7 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
287 287
   errorPrev = error;
288 288
 
289 289
   if (report) {
290
-    SERIAL_CHAR(axis_codes[encoderAxis]);
290
+    SERIAL_CHAR(AXIS_CHAR(encoderAxis));
291 291
     SERIAL_ECHOLNPGM(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
292 292
   }
293 293
 
@@ -657,7 +657,7 @@ void I2CPositionEncodersMgr::report_position(const int8_t idx, const bool units,
657 657
   else {
658 658
     if (noOffset) {
659 659
       const int32_t raw_count = encoders[idx].get_raw_count();
660
-      SERIAL_CHAR(axis_codes[encoders[idx].get_axis()], ' ');
660
+      SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()], ' ');
661 661
 
662 662
       for (uint8_t j = 31; j > 0; j--)
663 663
         SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j)));
@@ -712,7 +712,7 @@ void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const
712 712
   // and enable it (it will likely have failed initialization on power-up, before the address change).
713 713
   const int8_t idx = idx_from_addr(newaddr);
714 714
   if (idx >= 0 && !encoders[idx].get_active()) {
715
-    SERIAL_CHAR(axis_codes[encoders[idx].get_axis()]);
715
+    SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()]);
716 716
     SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again.");
717 717
     encoders[idx].set_active(encoders[idx].passes_test(true));
718 718
   }
@@ -814,7 +814,7 @@ void I2CPositionEncodersMgr::M860() {
814 814
 
815 815
   if (I2CPE_idx == 0xFF) {
816 816
     LOOP_LOGICAL_AXES(i) {
817
-      if (!I2CPE_anyaxis || parser.seen_test(axis_codes[i])) {
817
+      if (!I2CPE_anyaxis || parser.seen_test(AXIS_CHAR(i))) {
818 818
         const uint8_t idx = idx_from_axis(AxisEnum(i));
819 819
         if ((int8_t)idx >= 0) report_position(idx, hasU, hasO);
820 820
       }
@@ -841,7 +841,7 @@ void I2CPositionEncodersMgr::M861() {
841 841
 
842 842
   if (I2CPE_idx == 0xFF) {
843 843
     LOOP_LOGICAL_AXES(i) {
844
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
844
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
845 845
         const uint8_t idx = idx_from_axis(AxisEnum(i));
846 846
         if ((int8_t)idx >= 0) report_status(idx);
847 847
       }
@@ -869,7 +869,7 @@ void I2CPositionEncodersMgr::M862() {
869 869
 
870 870
   if (I2CPE_idx == 0xFF) {
871 871
     LOOP_LOGICAL_AXES(i) {
872
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
872
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
873 873
         const uint8_t idx = idx_from_axis(AxisEnum(i));
874 874
         if ((int8_t)idx >= 0) test_axis(idx);
875 875
       }
@@ -900,7 +900,7 @@ void I2CPositionEncodersMgr::M863() {
900 900
 
901 901
   if (I2CPE_idx == 0xFF) {
902 902
     LOOP_LOGICAL_AXES(i) {
903
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
903
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
904 904
         const uint8_t idx = idx_from_axis(AxisEnum(i));
905 905
         if ((int8_t)idx >= 0) calibrate_steps_mm(idx, iterations);
906 906
       }
@@ -976,7 +976,7 @@ void I2CPositionEncodersMgr::M865() {
976 976
 
977 977
   if (!I2CPE_addr) {
978 978
     LOOP_LOGICAL_AXES(i) {
979
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
979
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
980 980
         const uint8_t idx = idx_from_axis(AxisEnum(i));
981 981
         if ((int8_t)idx >= 0) report_module_firmware(encoders[idx].get_address());
982 982
       }
@@ -1007,7 +1007,7 @@ void I2CPositionEncodersMgr::M866() {
1007 1007
 
1008 1008
   if (I2CPE_idx == 0xFF) {
1009 1009
     LOOP_LOGICAL_AXES(i) {
1010
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
1010
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
1011 1011
         const uint8_t idx = idx_from_axis(AxisEnum(i));
1012 1012
         if ((int8_t)idx >= 0) {
1013 1013
           if (hasR)
@@ -1045,7 +1045,7 @@ void I2CPositionEncodersMgr::M867() {
1045 1045
 
1046 1046
   if (I2CPE_idx == 0xFF) {
1047 1047
     LOOP_LOGICAL_AXES(i) {
1048
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
1048
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
1049 1049
         const uint8_t idx = idx_from_axis(AxisEnum(i));
1050 1050
         if ((int8_t)idx >= 0) {
1051 1051
           const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff;
@@ -1081,7 +1081,7 @@ void I2CPositionEncodersMgr::M868() {
1081 1081
 
1082 1082
   if (I2CPE_idx == 0xFF) {
1083 1083
     LOOP_LOGICAL_AXES(i) {
1084
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
1084
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
1085 1085
         const uint8_t idx = idx_from_axis(AxisEnum(i));
1086 1086
         if ((int8_t)idx >= 0) {
1087 1087
           if (newThreshold != -9999)
@@ -1115,7 +1115,7 @@ void I2CPositionEncodersMgr::M869() {
1115 1115
 
1116 1116
   if (I2CPE_idx == 0xFF) {
1117 1117
     LOOP_LOGICAL_AXES(i) {
1118
-      if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
1118
+      if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
1119 1119
         const uint8_t idx = idx_from_axis(AxisEnum(i));
1120 1120
         if ((int8_t)idx >= 0) report_error(idx);
1121 1121
       }

+ 5
- 5
Marlin/src/feature/encoder_i2c.h Bestand weergeven

@@ -261,32 +261,32 @@ class I2CPositionEncodersMgr {
261 261
 
262 262
     static void report_error_count(const int8_t idx, const AxisEnum axis) {
263 263
       CHECK_IDX();
264
-      SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis is ", encoders[idx].get_error_count());
264
+      SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(AXIS_CHAR(axis)), " axis is ", encoders[idx].get_error_count());
265 265
     }
266 266
 
267 267
     static void reset_error_count(const int8_t idx, const AxisEnum axis) {
268 268
       CHECK_IDX();
269 269
       encoders[idx].set_error_count(0);
270
-      SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis has been reset.");
270
+      SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(AXIS_CHAR(axis)), " axis has been reset.");
271 271
     }
272 272
 
273 273
     static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
274 274
       CHECK_IDX();
275 275
       encoders[idx].set_ec_enabled(enabled);
276
-      SERIAL_ECHOPGM("Error correction on ", AS_CHAR(axis_codes[axis]));
276
+      SERIAL_ECHOPGM("Error correction on ", AS_CHAR(AXIS_CHAR(axis)));
277 277
       SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n");
278 278
     }
279 279
 
280 280
     static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
281 281
       CHECK_IDX();
282 282
       encoders[idx].set_ec_threshold(newThreshold);
283
-      SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis set to ", newThreshold, "mm.");
283
+      SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(AXIS_CHAR(axis)), " axis set to ", newThreshold, "mm.");
284 284
     }
285 285
 
286 286
     static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
287 287
       CHECK_IDX();
288 288
       const float threshold = encoders[idx].get_ec_threshold();
289
-      SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis is ", threshold, "mm.");
289
+      SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(AXIS_CHAR(axis)), " axis is ", threshold, "mm.");
290 290
     }
291 291
 
292 292
     static int8_t idx_from_axis(const AxisEnum axis) {

+ 2
- 2
Marlin/src/gcode/config/M200-M205.cpp Bestand weergeven

@@ -125,7 +125,7 @@ void GcodeSuite::M201() {
125 125
   #endif
126 126
 
127 127
   LOOP_LOGICAL_AXES(i) {
128
-    if (parser.seenval(axis_codes[i])) {
128
+    if (parser.seenval(AXIS_CHAR(i))) {
129 129
       const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
130 130
       planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a));
131 131
     }
@@ -174,7 +174,7 @@ void GcodeSuite::M203() {
174 174
   if (target_extruder < 0) return;
175 175
 
176 176
   LOOP_LOGICAL_AXES(i)
177
-    if (parser.seenval(axis_codes[i])) {
177
+    if (parser.seenval(AXIS_CHAR(i))) {
178 178
       const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
179 179
       planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a));
180 180
     }

+ 1
- 1
Marlin/src/gcode/config/M92.cpp Bestand weergeven

@@ -47,7 +47,7 @@ void GcodeSuite::M92() {
47 47
     return M92_report(true, target_extruder);
48 48
 
49 49
   LOOP_LOGICAL_AXES(i) {
50
-    if (parser.seenval(axis_codes[i])) {
50
+    if (parser.seenval(AXIS_CHAR(i))) {
51 51
       if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
52 52
         planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i);
53 53
       else {

+ 3
- 3
Marlin/src/gcode/control/M17_M18_M84.cpp Bestand weergeven

@@ -75,7 +75,7 @@ void do_enable(const stepper_flags_t to_enable) {
75 75
   LOOP_NUM_AXES(a) {
76 76
     if (TEST(shall_enable, a)) {
77 77
       stepper.enable_axis(AxisEnum(a));         // Mark and enable the requested axis
78
-      DEBUG_ECHOLNPGM("Enabled ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
78
+      DEBUG_ECHOLNPGM("Enabled ", AXIS_CHAR(a), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
79 79
       also_enabled |= enable_overlap[a];
80 80
     }
81 81
   }
@@ -157,7 +157,7 @@ void try_to_disable(const stepper_flags_t to_disable) {
157 157
   // Attempt to disable all flagged axes
158 158
   LOOP_NUM_AXES(a)
159 159
     if (TEST(to_disable.bits, a)) {
160
-      DEBUG_ECHOPGM("Try to disable ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
160
+      DEBUG_ECHOPGM("Try to disable ", AXIS_CHAR(a), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
161 161
       if (stepper.disable_axis(AxisEnum(a))) {            // Mark the requested axis and request to disable
162 162
         DEBUG_ECHOPGM("OK");
163 163
         still_enabled &= ~(_BV(a) | enable_overlap[a]);   // If actually disabled, clear one or more tracked bits
@@ -195,7 +195,7 @@ void try_to_disable(const stepper_flags_t to_disable) {
195 195
   // If any of the requested axes are still enabled, give a warning
196 196
   LOOP_NUM_AXES(a) {
197 197
     if (TEST(still_enabled, a)) {
198
-      SERIAL_CHAR(axis_codes[a]);
198
+      SERIAL_CHAR(AXIS_CHAR(a));
199 199
       overlap_warning(stepper.axis_enabled.bits & enable_overlap[a]);
200 200
     }
201 201
   }

+ 4
- 4
Marlin/src/gcode/control/M350_M351.cpp Bestand weergeven

@@ -40,21 +40,21 @@ void GcodeSuite::M350() {
40 40
 }
41 41
 
42 42
 /**
43
- * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B
43
+ * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z . . . E [B]
44 44
  *       S# determines MS1, MS2 or MS3, X# sets the pin high/low.
45 45
  */
46 46
 void GcodeSuite::M351() {
47 47
   if (parser.seenval('S')) switch (parser.value_byte()) {
48 48
     case 1:
49
-      LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
49
+      LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
50 50
       if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1, -1);
51 51
       break;
52 52
     case 2:
53
-      LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
53
+      LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
54 54
       if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte(), -1);
55 55
       break;
56 56
     case 3:
57
-      LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, -1, parser.value_byte());
57
+      LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, -1, -1, parser.value_byte());
58 58
       if (parser.seenval('B')) stepper.microstep_ms(4, -1, -1, parser.value_byte());
59 59
       break;
60 60
   }

+ 2
- 2
Marlin/src/gcode/feature/L6470/M906.cpp Bestand weergeven

@@ -211,7 +211,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
211 211
  *     1 - monitor only X2, Y2, Z2
212 212
  *     2 - monitor only Z3
213 213
  *     3 - monitor only Z4
214
- * Xxxx, Yxxx, Zxxx, Exxx - axis to change (optional)
214
+ * Xxxx, Yxxx, Zxxx, Axxx, Bxxx, Cxxx, Uxxx, Vxxx, Wxxx, Exxx - axis to change (optional)
215 215
  *     L6474 - current in mA (4A max)
216 216
  *     All others - 0-255
217 217
  *
@@ -236,7 +236,7 @@ void GcodeSuite::M906() {
236 236
     constexpr int8_t index = -1;
237 237
   #endif
238 238
 
239
-  LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) {
239
+  LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) {
240 240
 
241 241
     report_current = false;
242 242
 

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M122.cpp Bestand weergeven

@@ -35,7 +35,7 @@ void GcodeSuite::M122() {
35 35
   xyze_bool_t print_axis = ARRAY_N_1(LOGICAL_AXES, false);
36 36
 
37 37
   bool print_all = true;
38
-  LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) { print_axis[i] = true; print_all = false; }
38
+  LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) { print_axis[i] = true; print_all = false; }
39 39
 
40 40
   if (print_all) LOOP_LOGICAL_AXES(i) print_axis[i] = true;
41 41
 

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M569.cpp Bestand weergeven

@@ -53,7 +53,7 @@ static void set_stealth_status(const bool enable, const int8_t eindex) {
53 53
     constexpr int8_t index = -1;
54 54
   #endif
55 55
 
56
-  LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) {
56
+  LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
57 57
     switch (i) {
58 58
       case X_AXIS:
59 59
         TERN_(X_HAS_STEALTHCHOP,  if (index < 0 || index == 0) TMC_SET_STEALTH(X));

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M906.cpp Bestand weergeven

@@ -66,7 +66,7 @@ void GcodeSuite::M906() {
66 66
     constexpr int8_t index = -1;
67 67
   #endif
68 68
 
69
-  LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) {
69
+  LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) {
70 70
     report = false;
71 71
     switch (i) {
72 72
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M911-M914.cpp Bestand weergeven

@@ -288,7 +288,7 @@
288 288
     #elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
289 289
       constexpr int8_t index = -1;
290 290
     #endif
291
-    LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) {
291
+    LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(AXIS_CHAR(i))) {
292 292
       report = false;
293 293
       switch (i) {
294 294
         #if X_HAS_STEALTHCHOP || X2_HAS_STEALTHCHOP

+ 2
- 2
Marlin/src/gcode/feature/trinamic/M919.cpp Bestand weergeven

@@ -112,13 +112,13 @@ void GcodeSuite::M919() {
112 112
     int8_t eindex = -1;
113 113
   #endif
114 114
   bool report = true;
115
-  LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) {
115
+  LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) {
116 116
     report = false;
117 117
 
118 118
     // Get the chopper timing for the specified axis and index
119 119
     switch (i) {
120 120
       default: // A specified axis isn't Trinamic
121
-        SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(axis_codes[i]), " has no TMC drivers.");
121
+        SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(AXIS_CHAR(i)), " has no TMC drivers.");
122 122
         break;
123 123
 
124 124
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)

+ 2
- 2
Marlin/src/gcode/geometry/G92.cpp Bestand weergeven

@@ -74,7 +74,7 @@ void GcodeSuite::G92() {
74 74
     #if ENABLED(POWER_LOSS_RECOVERY)
75 75
       case 9:                                                         // G92.9 - Set Current Position directly (like Marlin 1.0)
76 76
         LOOP_LOGICAL_AXES(i) {
77
-          if (parser.seenval(axis_codes[i])) {
77
+          if (parser.seenval(AXIS_CHAR(i))) {
78 78
             if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
79 79
               sync_XYZE = true;
80 80
             else {
@@ -88,7 +88,7 @@ void GcodeSuite::G92() {
88 88
 
89 89
     case 0:
90 90
       LOOP_LOGICAL_AXES(i) {
91
-        if (parser.seenval(axis_codes[i])) {
91
+        if (parser.seenval(AXIS_CHAR(i))) {
92 92
           const float l = parser.value_axis_units((AxisEnum)i),       // Given axis coordinate value, converted to millimeters
93 93
                       v = TERN0(HAS_EXTRUDERS, i == E_AXIS) ? l : LOGICAL_TO_NATIVE(l, i),  // Axis position in NATIVE space (applying the existing offset)
94 94
                       d = v - current_position[i];                    // How much is the current axis position altered by?

+ 1
- 1
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Bestand weergeven

@@ -432,7 +432,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
432 432
   const bool is_inch = parser.using_inch_units();
433 433
   const AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, axis);
434 434
   const uint8_t offs = a * (is_inch ? XYZ_SPACING_IN : XYZ_SPACING);
435
-  lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]);
435
+  lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, AXIS_CHAR(axis));
436 436
   lcd_moveto((is_inch ? X_VALUE_POS_IN : X_VALUE_POS) + offs, XYZ_BASELINE);
437 437
 
438 438
   if (blink)

+ 1
- 1
Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp Bestand weergeven

@@ -70,7 +70,7 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*
70 70
     else if (ch == '$' && itemString)
71 71
       add(itemString);
72 72
     else if (ch == '@')
73
-      add_character(axis_codes[index]);
73
+      add_character(AXIS_CHAR(index));
74 74
     else
75 75
       add_character(ch);
76 76
   }

+ 1
- 1
Marlin/src/lcd/lcdprint.cpp Bestand weergeven

@@ -75,7 +75,7 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i
75 75
       n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH);
76 76
     }
77 77
     else if (ch == '@') {
78
-      lcd_put_wchar(axis_codes[ind]);
78
+      lcd_put_wchar(AXIS_CHAR(ind));
79 79
       n--;
80 80
     }
81 81
     else {

+ 2
- 2
Marlin/src/lcd/marlinui.cpp Bestand weergeven

@@ -831,7 +831,7 @@ void MarlinUI::init() {
831 831
             TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
832 832
           );
833 833
 
834
-          //SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(axis_codes[axis]), " at FR ", fr_mm_s);
834
+          //SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(AXIS_CHAR(axis)), " at FR ", fr_mm_s);
835 835
 
836 836
           axis = NO_AXIS_ENUM;
837 837
 
@@ -848,7 +848,7 @@ void MarlinUI::init() {
848 848
       TERN_(MULTI_E_MANUAL, if (move_axis == E_AXIS) e_index = eindex);
849 849
       start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
850 850
       axis = move_axis;
851
-      //SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(axis_codes[axis]), " soon.");
851
+      //SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(AXIS_CHAR(axis)), " soon.");
852 852
     }
853 853
 
854 854
     #if ENABLED(AUTO_BED_LEVELING_UBL)

+ 1
- 1
Marlin/src/lcd/tft/tft_string.cpp Bestand weergeven

@@ -116,7 +116,7 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullpt
116 116
     else if (ch == '$' && itemString)
117 117
       add(itemString);
118 118
     else if (ch == '@')
119
-      add_character(axis_codes[index]);
119
+      add_character(AXIS_CHAR(index));
120 120
     else
121 121
       add_character(ch);
122 122
   }

+ 3
- 3
Marlin/src/libs/L64XX/L64XX_Marlin.cpp Bestand weergeven

@@ -412,11 +412,11 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
412 412
   }
413 413
 
414 414
   uint8_t found_displacement = false;
415
-  LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) {
415
+  LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(AXIS_CHAR(i))) {
416 416
     found_displacement = true;
417 417
     displacement = _displacement;
418 418
     const uint8_t axis_offset = parser.byteval('J');
419
-    axis_mon[0][0] = axis_codes[i];         // Axis first character, one of XYZ...E
419
+    axis_mon[0][0] = AXIS_CHAR(i);          // Axis first character, one of XYZ...E
420 420
     const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E',
421 421
                one_or_more = !single_or_e && axis_offset == 0;
422 422
     uint8_t driver_count_local = 0;         // Can't use "driver_count" directly as a subscript because it's passed by reference
@@ -667,7 +667,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
667 667
     static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
668 668
     const uint8_t num_feedrates = COUNT(default_max_feedrate);
669 669
     for (j = 0; j < num_feedrates; j++) {
670
-      if (axis_codes[j] == axis_mon[0][0]) {
670
+      if (AXIS_CHAR(j) == axis_mon[0][0]) {
671 671
         final_feedrate = default_max_feedrate[j];
672 672
         break;
673 673
       }

Laden…
Annuleren
Opslaan