Przeglądaj źródła

🎨 Misc cleanup and fixes

Scott Lahteine 4 lat temu
rodzic
commit
abbe3f0dc7

+ 1
- 1
Marlin/src/core/debug_section.h Wyświetl plik

44
       SERIAL_ECHOPGM_P(the_msg);
44
       SERIAL_ECHOPGM_P(the_msg);
45
     }
45
     }
46
     SERIAL_CHAR(' ');
46
     SERIAL_CHAR(' ');
47
-    print_xyz(current_position);
47
+    print_pos(current_position);
48
   }
48
   }
49
 };
49
 };

+ 8
- 8
Marlin/src/core/language.h Wyświetl plik

277
 #define STR_REMINDER_SAVE_SETTINGS          "Remember to save!"
277
 #define STR_REMINDER_SAVE_SETTINGS          "Remember to save!"
278
 #define STR_PASSWORD_SET                    "Password is "
278
 #define STR_PASSWORD_SET                    "Password is "
279
 
279
 
280
-// LCD Menu Messages
281
-
282
-#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h)
283
-#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M)
284
-
285
-#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h)
286
-#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M)
287
-
288
 #define STR_X "X"
280
 #define STR_X "X"
289
 #define STR_Y "Y"
281
 #define STR_Y "Y"
290
 #define STR_Z "Z"
282
 #define STR_Z "Z"
386
 #define LCD_STR_E6 "E" LCD_STR_N6
378
 #define LCD_STR_E6 "E" LCD_STR_N6
387
 #define LCD_STR_E7 "E" LCD_STR_N7
379
 #define LCD_STR_E7 "E" LCD_STR_N7
388
 
380
 
381
+// Include localized LCD Menu Messages
382
+
383
+#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h)
384
+#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M)
385
+
386
+#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h)
387
+#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M)
388
+
389
 // Use superscripts, if possible. Evaluated at point of use.
389
 // Use superscripts, if possible. Evaluated at point of use.
390
 #define SUPERSCRIPT_TWO   TERN(NOT_EXTENDED_ISO10646_1_5X7, "^2", "²")
390
 #define SUPERSCRIPT_TWO   TERN(NOT_EXTENDED_ISO10646_1_5X7, "^2", "²")
391
 #define SUPERSCRIPT_THREE TERN(NOT_EXTENDED_ISO10646_1_5X7, "^3", "³")
391
 #define SUPERSCRIPT_THREE TERN(NOT_EXTENDED_ISO10646_1_5X7, "^3", "³")

+ 1
- 1
Marlin/src/core/serial.cpp Wyświetl plik

101
   }
101
   }
102
 }
102
 }
103
 
103
 
104
-void print_xyz(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
104
+void print_pos(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
105
   if (prefix) serialprintPGM(prefix);
105
   if (prefix) serialprintPGM(prefix);
106
   SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);
106
   SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);
107
   if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
107
   if (suffix) serialprintPGM(suffix); else SERIAL_EOL();

+ 5
- 5
Marlin/src/core/serial.h Wyświetl plik

310
 void serial_spaces(uint8_t count);
310
 void serial_spaces(uint8_t count);
311
 
311
 
312
 void print_bin(const uint16_t val);
312
 void print_bin(const uint16_t val);
313
-void print_xyz(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
313
+void print_pos(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
314
 
314
 
315
-inline void print_xyz(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) {
316
-  print_xyz(xyz.x, xyz.y, xyz.z, prefix, suffix);
315
+inline void print_pos(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) {
316
+  print_pos(xyz.x, xyz.y, xyz.z, prefix, suffix);
317
 }
317
 }
318
 
318
 
319
-#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(VAR, PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0)
320
-#define SERIAL_XYZ(PREFIX,V...) do { print_xyz(V, PSTR(PREFIX), nullptr); }while(0)
319
+#define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0)
320
+#define SERIAL_XYZ(PREFIX,V...) do { print_pos(V, PSTR(PREFIX), nullptr); }while(0)

+ 10
- 10
Marlin/src/core/types.h Wyświetl plik

30
 typedef const __FlashStringHelper *progmem_str;
30
 typedef const __FlashStringHelper *progmem_str;
31
 
31
 
32
 //
32
 //
33
+// Conditional type assignment magic. For example...
34
+//
35
+// typename IF<(MYOPT==12), int, float>::type myvar;
36
+//
37
+template <bool, class L, class R>
38
+struct IF { typedef R type; };
39
+template <class L, class R>
40
+struct IF<true, L, R> { typedef L type; };
41
+
42
+//
33
 // Enumerated axis indices
43
 // Enumerated axis indices
34
 //
44
 //
35
 //  - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space
45
 //  - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space
58
 #define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N)
68
 #define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N)
59
 
69
 
60
 //
70
 //
61
-// Conditional type assignment magic. For example...
62
-//
63
-// typename IF<(MYOPT==12), int, float>::type myvar;
64
-//
65
-template <bool, class L, class R>
66
-struct IF { typedef R type; };
67
-template <class L, class R>
68
-struct IF<true, L, R> { typedef L type; };
69
-
70
-//
71
 // feedRate_t is just a humble float
71
 // feedRate_t is just a humble float
72
 //
72
 //
73
 typedef float feedRate_t;
73
 typedef float feedRate_t;

+ 16
- 20
Marlin/src/gcode/calibrate/G425.cpp Wyświetl plik

194
 inline float measure(const AxisEnum axis, const int dir, const bool stop_state, float * const backlash_ptr, const float uncertainty) {
194
 inline float measure(const AxisEnum axis, const int dir, const bool stop_state, float * const backlash_ptr, const float uncertainty) {
195
   const bool fast = uncertainty == CALIBRATION_MEASUREMENT_UNKNOWN;
195
   const bool fast = uncertainty == CALIBRATION_MEASUREMENT_UNKNOWN;
196
 
196
 
197
-  // Save position
198
-  destination = current_position;
199
-  const float start_pos = destination[axis];
197
+  // Save the current position of the specified axis
198
+  const float start_pos = current_position[axis];
199
+
200
+  // Take a measurement. Only the specified axis will be affected.
200
   const float measured_pos = measuring_movement(axis, dir, stop_state, fast);
201
   const float measured_pos = measuring_movement(axis, dir, stop_state, fast);
202
+
201
   // Measure backlash
203
   // Measure backlash
202
   if (backlash_ptr && !fast) {
204
   if (backlash_ptr && !fast) {
203
     const float release_pos = measuring_movement(axis, -dir, !stop_state, fast);
205
     const float release_pos = measuring_movement(axis, -dir, !stop_state, fast);
204
     *backlash_ptr = ABS(release_pos - measured_pos);
206
     *backlash_ptr = ABS(release_pos - measured_pos);
205
   }
207
   }
206
-  // Return to starting position
208
+
209
+  // Move back to the starting position
210
+  destination = current_position;
207
   destination[axis] = start_pos;
211
   destination[axis] = start_pos;
208
   do_blocking_move_to(destination, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL));
212
   do_blocking_move_to(destination, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL));
209
   return measured_pos;
213
   return measured_pos;
235
       }
239
       }
236
     #endif
240
     #endif
237
     #if AXIS_CAN_CALIBRATE(X)
241
     #if AXIS_CAN_CALIBRATE(X)
242
+      case RIGHT: dir = -1;
238
       case LEFT:  axis = X_AXIS; break;
243
       case LEFT:  axis = X_AXIS; break;
239
-      case RIGHT: axis = X_AXIS; dir = -1; break;
240
     #endif
244
     #endif
241
     #if AXIS_CAN_CALIBRATE(Y)
245
     #if AXIS_CAN_CALIBRATE(Y)
246
+      case BACK:  dir = -1;
242
       case FRONT: axis = Y_AXIS; break;
247
       case FRONT: axis = Y_AXIS; break;
243
-      case BACK:  axis = Y_AXIS; dir = -1; break;
244
     #endif
248
     #endif
245
     default: return;
249
     default: return;
246
   }
250
   }
303
 
307
 
304
   // The difference between the known and the measured location
308
   // The difference between the known and the measured location
305
   // of the calibration object is the positional error
309
   // of the calibration object is the positional error
306
-  m.pos_error.x = (0
307
-    #if HAS_X_CENTER
308
-      + true_center.x - m.obj_center.x
309
-    #endif
310
-  );
311
-  m.pos_error.y = (0
312
-    #if HAS_Y_CENTER
313
-      + true_center.y - m.obj_center.y
314
-    #endif
315
-  );
310
+  m.pos_error.x = TERN0(HAS_X_CENTER, true_center.x - m.obj_center.x);
311
+  m.pos_error.y = TERN0(HAS_Y_CENTER, true_center.y - m.obj_center.y);
316
   m.pos_error.z = true_center.z - m.obj_center.z;
312
   m.pos_error.z = true_center.z - m.obj_center.z;
317
 }
313
 }
318
 
314
 
589
   SET_SOFT_ENDSTOP_LOOSE(true);
585
   SET_SOFT_ENDSTOP_LOOSE(true);
590
 
586
 
591
   measurements_t m;
587
   measurements_t m;
592
-  float uncertainty = parser.seenval('U') ? parser.value_float() : CALIBRATION_MEASUREMENT_UNCERTAIN;
588
+  const float uncertainty = parser.floatval('U', CALIBRATION_MEASUREMENT_UNCERTAIN);
593
 
589
 
594
-  if (parser.seen('B'))
590
+  if (parser.seen_test('B'))
595
     calibrate_backlash(m, uncertainty);
591
     calibrate_backlash(m, uncertainty);
596
-  else if (parser.seen('T'))
597
-    calibrate_toolhead(m, uncertainty, parser.has_value() ? parser.value_int() : active_extruder);
592
+  else if (parser.seen_test('T'))
593
+    calibrate_toolhead(m, uncertainty, parser.intval('T', active_extruder));
598
   #if ENABLED(CALIBRATION_REPORTING)
594
   #if ENABLED(CALIBRATION_REPORTING)
599
     else if (parser.seen('V')) {
595
     else if (parser.seen('V')) {
600
       probe_sides(m, uncertainty);
596
       probe_sides(m, uncertainty);

+ 11
- 21
Marlin/src/gcode/config/M200-M205.cpp Wyświetl plik

87
   #endif
87
   #endif
88
 
88
 
89
   LOOP_XYZE(i) {
89
   LOOP_XYZE(i) {
90
-    if (parser.seen(axis_codes[i])) {
90
+    if (parser.seenval(axis_codes[i])) {
91
       const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i);
91
       const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i);
92
       planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a));
92
       planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a));
93
     }
93
     }
105
   if (target_extruder < 0) return;
105
   if (target_extruder < 0) return;
106
 
106
 
107
   LOOP_XYZE(i)
107
   LOOP_XYZE(i)
108
-    if (parser.seen(axis_codes[i])) {
108
+    if (parser.seenval(axis_codes[i])) {
109
       const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i);
109
       const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i);
110
       planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a));
110
       planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a));
111
     }
111
     }
147
  *    J = Junction Deviation (mm) (If not using CLASSIC_JERK)
147
  *    J = Junction Deviation (mm) (If not using CLASSIC_JERK)
148
  */
148
  */
149
 void GcodeSuite::M205() {
149
 void GcodeSuite::M205() {
150
-  #if HAS_JUNCTION_DEVIATION
151
-    #define J_PARAM  "J"
152
-  #else
153
-    #define J_PARAM
154
-  #endif
155
-  #if HAS_CLASSIC_JERK
156
-    #define XYZE_PARAM "XYZE"
157
-  #else
158
-    #define XYZE_PARAM
159
-  #endif
160
-  if (!parser.seen("BST" J_PARAM XYZE_PARAM)) return;
150
+  if (!parser.seen("BST" TERN_(HAS_JUNCTION_DEVIATION, "J") TERN_(HAS_CLASSIC_JERK, "XYZE"))) return;
161
 
151
 
162
   //planner.synchronize();
152
   //planner.synchronize();
163
-  if (parser.seen('B')) planner.settings.min_segment_time_us = parser.value_ulong();
164
-  if (parser.seen('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
165
-  if (parser.seen('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
153
+  if (parser.seenval('B')) planner.settings.min_segment_time_us = parser.value_ulong();
154
+  if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
155
+  if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
166
   #if HAS_JUNCTION_DEVIATION
156
   #if HAS_JUNCTION_DEVIATION
167
-    if (parser.seen('J')) {
157
+    if (parser.seenval('J')) {
168
       const float junc_dev = parser.value_linear_units();
158
       const float junc_dev = parser.value_linear_units();
169
       if (WITHIN(junc_dev, 0.01f, 0.3f)) {
159
       if (WITHIN(junc_dev, 0.01f, 0.3f)) {
170
         planner.junction_deviation_mm = junc_dev;
160
         planner.junction_deviation_mm = junc_dev;
175
     }
165
     }
176
   #endif
166
   #endif
177
   #if HAS_CLASSIC_JERK
167
   #if HAS_CLASSIC_JERK
178
-    if (parser.seen('X')) planner.set_max_jerk(X_AXIS, parser.value_linear_units());
179
-    if (parser.seen('Y')) planner.set_max_jerk(Y_AXIS, parser.value_linear_units());
180
-    if (parser.seen('Z')) {
168
+    if (parser.seenval('X')) planner.set_max_jerk(X_AXIS, parser.value_linear_units());
169
+    if (parser.seenval('Y')) planner.set_max_jerk(Y_AXIS, parser.value_linear_units());
170
+    if (parser.seenval('Z')) {
181
       planner.set_max_jerk(Z_AXIS, parser.value_linear_units());
171
       planner.set_max_jerk(Z_AXIS, parser.value_linear_units());
182
       #if HAS_MESH && DISABLED(LIMITED_JERK_EDITING)
172
       #if HAS_MESH && DISABLED(LIMITED_JERK_EDITING)
183
         if (planner.max_jerk.z <= 0.1f)
173
         if (planner.max_jerk.z <= 0.1f)
185
       #endif
175
       #endif
186
     }
176
     }
187
     #if HAS_CLASSIC_E_JERK
177
     #if HAS_CLASSIC_E_JERK
188
-      if (parser.seen('E')) planner.set_max_jerk(E_AXIS, parser.value_linear_units());
178
+      if (parser.seenval('E')) planner.set_max_jerk(E_AXIS, parser.value_linear_units());
189
     #endif
179
     #endif
190
   #endif
180
   #endif
191
 }
181
 }

+ 3
- 6
Marlin/src/gcode/config/M92.cpp Wyświetl plik

42
     }
42
     }
43
   #endif
43
   #endif
44
 
44
 
45
-  UNUSED_E(e);
45
+  UNUSED(e);
46
 }
46
 }
47
 
47
 
48
 /**
48
 /**
64
   if (target_extruder < 0) return;
64
   if (target_extruder < 0) return;
65
 
65
 
66
   // No arguments? Show M92 report.
66
   // No arguments? Show M92 report.
67
-  if (!parser.seen("XYZE"
68
-    #if ENABLED(MAGIC_NUMBERS_GCODE)
69
-      "HL"
70
-    #endif
71
-  )) return report_M92(true, target_extruder);
67
+  if (!parser.seen("XYZE" TERN_(MAGIC_NUMBERS_GCODE, "HL")))
68
+    return report_M92(true, target_extruder);
72
 
69
 
73
   LOOP_XYZE(i) {
70
   LOOP_XYZE(i) {
74
     if (parser.seenval(axis_codes[i])) {
71
     if (parser.seenval(axis_codes[i])) {

+ 8
- 8
Marlin/src/gcode/control/M17_M18_M84.cpp Wyświetl plik

34
  */
34
  */
35
 void GcodeSuite::M17() {
35
 void GcodeSuite::M17() {
36
   if (parser.seen("XYZE")) {
36
   if (parser.seen("XYZE")) {
37
-    if (parser.seen('X')) ENABLE_AXIS_X();
38
-    if (parser.seen('Y')) ENABLE_AXIS_Y();
39
-    if (parser.seen('Z')) ENABLE_AXIS_Z();
40
-    if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen('E'))) enable_e_steppers();
37
+    if (parser.seen_test('X')) ENABLE_AXIS_X();
38
+    if (parser.seen_test('Y')) ENABLE_AXIS_Y();
39
+    if (parser.seen_test('Z')) ENABLE_AXIS_Z();
40
+    if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) enable_e_steppers();
41
   }
41
   }
42
   else {
42
   else {
43
     LCD_MESSAGEPGM(MSG_NO_MOVE);
43
     LCD_MESSAGEPGM(MSG_NO_MOVE);
56
   else {
56
   else {
57
     if (parser.seen("XYZE")) {
57
     if (parser.seen("XYZE")) {
58
       planner.synchronize();
58
       planner.synchronize();
59
-      if (parser.seen('X')) DISABLE_AXIS_X();
60
-      if (parser.seen('Y')) DISABLE_AXIS_Y();
61
-      if (parser.seen('Z')) DISABLE_AXIS_Z();
62
-      if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen('E'))) disable_e_steppers();
59
+      if (parser.seen_test('X')) DISABLE_AXIS_X();
60
+      if (parser.seen_test('Y')) DISABLE_AXIS_Y();
61
+      if (parser.seen_test('Z')) DISABLE_AXIS_Z();
62
+      if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) disable_e_steppers();
63
     }
63
     }
64
     else
64
     else
65
       planner.finish_and_disable();
65
       planner.finish_and_disable();

+ 2
- 2
Marlin/src/gcode/control/M211.cpp Wyświetl plik

39
   SERIAL_ECHOPGM(STR_SOFT_ENDSTOPS);
39
   SERIAL_ECHOPGM(STR_SOFT_ENDSTOPS);
40
   if (parser.seen('S')) soft_endstop._enabled = parser.value_bool();
40
   if (parser.seen('S')) soft_endstop._enabled = parser.value_bool();
41
   serialprint_onoff(soft_endstop._enabled);
41
   serialprint_onoff(soft_endstop._enabled);
42
-  print_xyz(l_soft_min, PSTR(STR_SOFT_MIN), PSTR(" "));
43
-  print_xyz(l_soft_max, PSTR(STR_SOFT_MAX));
42
+  print_pos(l_soft_min, PSTR(STR_SOFT_MIN), PSTR(" "));
43
+  print_pos(l_soft_max, PSTR(STR_SOFT_MAX));
44
 }
44
 }
45
 
45
 
46
 #endif
46
 #endif

+ 18
- 28
Marlin/src/gcode/feature/trinamic/M911-M914.cpp Wyświetl plik

35
   #define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2160) || AXIS_DRIVER_TYPE(ST, TMC2208) || AXIS_DRIVER_TYPE(ST, TMC2209) || AXIS_DRIVER_TYPE(ST, TMC2660) || AXIS_DRIVER_TYPE(ST, TMC5130) || AXIS_DRIVER_TYPE(ST, TMC5160))
35
   #define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2160) || AXIS_DRIVER_TYPE(ST, TMC2208) || AXIS_DRIVER_TYPE(ST, TMC2209) || AXIS_DRIVER_TYPE(ST, TMC2660) || AXIS_DRIVER_TYPE(ST, TMC5130) || AXIS_DRIVER_TYPE(ST, TMC5160))
36
   #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
36
   #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
37
 
37
 
38
-  #define M91x_SOME_X (M91x_USE(X) || M91x_USE(X2))
39
-  #define M91x_SOME_Y (M91x_USE(Y) || M91x_USE(Y2))
40
-  #define M91x_SOME_Z (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4))
41
-  #define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5) || M91x_USE_E(6) || M91x_USE_E(7))
38
+  #if M91x_USE(X) || M91x_USE(X2)
39
+    #define M91x_SOME_X 1
40
+  #endif
41
+  #if M91x_USE(Y) || M91x_USE(Y2)
42
+    #define M91x_SOME_Y 1
43
+  #endif
44
+  #if M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4)
45
+    #define M91x_SOME_Z 1
46
+  #endif
47
+
48
+  #if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5) || M91x_USE_E(6) || M91x_USE_E(7)
49
+    #define M91x_SOME_E 1
50
+  #endif
42
 
51
 
43
   #if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E
52
   #if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E
44
     #error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160."
53
     #error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160."
112
    *       M912 E1  ; clear E1 only
121
    *       M912 E1  ; clear E1 only
113
    */
122
    */
114
   void GcodeSuite::M912() {
123
   void GcodeSuite::M912() {
115
-    #if M91x_SOME_X
116
-      const bool hasX = parser.seen(axis_codes.x);
117
-    #else
118
-      constexpr bool hasX = false;
119
-    #endif
120
-
121
-    #if M91x_SOME_Y
122
-      const bool hasY = parser.seen(axis_codes.y);
123
-    #else
124
-      constexpr bool hasY = false;
125
-    #endif
126
-
127
-    #if M91x_SOME_Z
128
-      const bool hasZ = parser.seen(axis_codes.z);
129
-    #else
130
-      constexpr bool hasZ = false;
131
-    #endif
132
-
133
-    #if M91x_SOME_E
134
-      const bool hasE = parser.seen(axis_codes.e);
135
-    #else
136
-      constexpr bool hasE = false;
137
-    #endif
124
+    const bool hasX = TERN0(M91x_SOME_X, parser.seen(axis_codes.x)),
125
+               hasY = TERN0(M91x_SOME_Y, parser.seen(axis_codes.y)),
126
+               hasZ = TERN0(M91x_SOME_Z, parser.seen(axis_codes.z)),
127
+               hasE = TERN0(M91x_SOME_E, parser.seen(axis_codes.e));
138
 
128
 
139
-    const bool hasNone = !hasX && !hasY && !hasZ && !hasE;
129
+    const bool hasNone = !hasE && !hasX && !hasY && !hasZ;
140
 
130
 
141
     #if M91x_SOME_X
131
     #if M91x_SOME_X
142
       const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF));
132
       const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF));

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

140
  *  - Set the feedrate, if included
140
  *  - Set the feedrate, if included
141
  */
141
  */
142
 void GcodeSuite::get_destination_from_command() {
142
 void GcodeSuite::get_destination_from_command() {
143
-  xyze_bool_t seen = { false, false, false, false };
143
+  xyze_bool_t seen{false};
144
 
144
 
145
   #if ENABLED(CANCEL_OBJECTS)
145
   #if ENABLED(CANCEL_OBJECTS)
146
     const bool &skip_move = cancelable.skipping;
146
     const bool &skip_move = cancelable.skipping;

+ 11
- 11
Marlin/src/gcode/host/M114.cpp Wyświetl plik

34
     #include "../../core/debug_out.h"
34
     #include "../../core/debug_out.h"
35
   #endif
35
   #endif
36
 
36
 
37
-  void report_xyze(const xyze_pos_t &pos, const uint8_t n=XYZE, const uint8_t precision=3) {
37
+  void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=XYZE, 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_CHAR(' ', axis_codes[a], ':');
43
     }
43
     }
44
     SERIAL_EOL();
44
     SERIAL_EOL();
45
   }
45
   }
46
-  inline void report_xyz(const xyze_pos_t &pos) { report_xyze(pos, XYZ); }
46
+  inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); }
47
 
47
 
48
-  void report_xyz(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_XYZ(a) {
50
     LOOP_XYZ(a) {
51
       SERIAL_CHAR(' ', XYZ_CHAR(a), ':');
51
       SERIAL_CHAR(' ', XYZ_CHAR(a), ':');
57
   void report_current_position_detail() {
57
   void report_current_position_detail() {
58
     // Position as sent by G-code
58
     // Position as sent by G-code
59
     SERIAL_ECHOPGM("\nLogical:");
59
     SERIAL_ECHOPGM("\nLogical:");
60
-    report_xyz(current_position.asLogical());
60
+    report_linear_axis_pos(current_position.asLogical());
61
 
61
 
62
     // Cartesian position in native machine space
62
     // Cartesian position in native machine space
63
     SERIAL_ECHOPGM("Raw:    ");
63
     SERIAL_ECHOPGM("Raw:    ");
64
-    report_xyz(current_position);
64
+    report_linear_axis_pos(current_position);
65
 
65
 
66
     xyze_pos_t leveled = current_position;
66
     xyze_pos_t leveled = current_position;
67
 
67
 
69
       // Current position with leveling applied
69
       // Current position with leveling applied
70
       SERIAL_ECHOPGM("Leveled:");
70
       SERIAL_ECHOPGM("Leveled:");
71
       planner.apply_leveling(leveled);
71
       planner.apply_leveling(leveled);
72
-      report_xyz(leveled);
72
+      report_linear_axis_pos(leveled);
73
 
73
 
74
       // Test planner un-leveling. This should match the Raw result.
74
       // Test planner un-leveling. This should match the Raw result.
75
       SERIAL_ECHOPGM("UnLevel:");
75
       SERIAL_ECHOPGM("UnLevel:");
76
       xyze_pos_t unleveled = leveled;
76
       xyze_pos_t unleveled = leveled;
77
       planner.unapply_leveling(unleveled);
77
       planner.unapply_leveling(unleveled);
78
-      report_xyz(unleveled);
78
+      report_linear_axis_pos(unleveled);
79
     #endif
79
     #endif
80
 
80
 
81
     #if IS_KINEMATIC
81
     #if IS_KINEMATIC
82
       // Kinematics applied to the leveled position
82
       // Kinematics applied to the leveled position
83
       SERIAL_ECHOPGM(TERN(IS_SCARA, "ScaraK: ", "DeltaK: "));
83
       SERIAL_ECHOPGM(TERN(IS_SCARA, "ScaraK: ", "DeltaK: "));
84
       inverse_kinematics(leveled);  // writes delta[]
84
       inverse_kinematics(leveled);  // writes delta[]
85
-      report_xyz(delta);
85
+      report_linear_axis_pos(delta);
86
     #endif
86
     #endif
87
 
87
 
88
     planner.synchronize();
88
     planner.synchronize();
165
         planner.get_axis_position_degrees(B_AXIS)
165
         planner.get_axis_position_degrees(B_AXIS)
166
       };
166
       };
167
       SERIAL_ECHOPGM("Degrees:");
167
       SERIAL_ECHOPGM("Degrees:");
168
-      report_xyze(deg, 2);
168
+      report_all_axis_pos(deg, 2);
169
     #endif
169
     #endif
170
 
170
 
171
     SERIAL_ECHOPGM("FromStp:");
171
     SERIAL_ECHOPGM("FromStp:");
172
     get_cartesian_from_steppers();  // writes 'cartes' (with forward kinematics)
172
     get_cartesian_from_steppers();  // writes 'cartes' (with forward kinematics)
173
     xyze_pos_t from_steppers = { cartes.x, cartes.y, cartes.z, planner.get_axis_position_mm(E_AXIS) };
173
     xyze_pos_t from_steppers = { cartes.x, cartes.y, cartes.z, planner.get_axis_position_mm(E_AXIS) };
174
-    report_xyze(from_steppers);
174
+    report_all_axis_pos(from_steppers);
175
 
175
 
176
     const xyze_float_t diff = from_steppers - leveled;
176
     const xyze_float_t diff = from_steppers - leveled;
177
     SERIAL_ECHOPGM("Diff:   ");
177
     SERIAL_ECHOPGM("Diff:   ");
178
-    report_xyze(diff);
178
+    report_all_axis_pos(diff);
179
 
179
 
180
     TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
180
     TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
181
   }
181
   }

+ 1
- 1
Marlin/src/gcode/motion/G0_G1.cpp Wyświetl plik

83
 
83
 
84
       if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
84
       if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
85
         // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
85
         // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
86
-        if (fwretract.autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) {
86
+        if (fwretract.autoretract_enabled && parser.seen('E') && !parser.seen("XYZ")) {
87
           const float echange = destination.e - current_position.e;
87
           const float echange = destination.e - current_position.e;
88
           // Is this a retract or recover move?
88
           // Is this a retract or recover move?
89
           if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) {
89
           if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) {

+ 4
- 4
Marlin/src/gcode/motion/G2_G3.cpp Wyświetl plik

291
  *    Mixing IJ/JK/KI with R will throw an error.
291
  *    Mixing IJ/JK/KI with R will throw an error.
292
  *
292
  *
293
  *  - R specifies the radius. X or Y (Y or Z / Z or X) is required.
293
  *  - R specifies the radius. X or Y (Y or Z / Z or X) is required.
294
- *    Omitting both XY/YZ/ZX will throw an error.
295
- *    XY/YZ/ZX must differ from the current XY/YZ/ZX.
296
- *    Mixing R with IJ/JK/KI will throw an error.
294
+ *      Omitting both XY/YZ/ZX will throw an error.
295
+ *      XY/YZ/ZX must differ from the current XY/YZ/ZX.
296
+ *      Mixing R with IJ/JK/KI will throw an error.
297
  *
297
  *
298
  *  - P specifies the number of full circles to do
298
  *  - P specifies the number of full circles to do
299
- *    before the specified arc move.
299
+ *      before the specified arc move.
300
  *
300
  *
301
  *  Examples:
301
  *  Examples:
302
  *
302
  *

+ 1
- 1
Marlin/src/gcode/parser.cpp Wyświetl plik

222
 
222
 
223
       #if ENABLED(GCODE_MOTION_MODES)
223
       #if ENABLED(GCODE_MOTION_MODES)
224
         if (letter == 'G'
224
         if (letter == 'G'
225
-          && (codenum <= TERN(ARC_SUPPORT, 3, 1) || codenum == 5 || TERN0(G38_PROBE_TARGET, codenum == 38))
225
+          && (codenum <= TERN(ARC_SUPPORT, 3, 1) || TERN0(BEZIER_CURVE_SUPPORT, codenum == 5) || TERN0(G38_PROBE_TARGET, codenum == 38))
226
         ) {
226
         ) {
227
           motion_mode_codenum = codenum;
227
           motion_mode_codenum = codenum;
228
           TERN_(USE_GCODE_SUBCODES, motion_mode_subcode = subcode);
228
           TERN_(USE_GCODE_SUBCODES, motion_mode_subcode = subcode);

+ 1
- 1
Marlin/src/gcode/parser.h Wyświetl plik

226
 
226
 
227
   // Seen any axis parameter
227
   // Seen any axis parameter
228
   static inline bool seen_axis() {
228
   static inline bool seen_axis() {
229
-    return seen_test('X') || seen_test('Y') || seen_test('Z') || seen_test('E');
229
+    return seen("XYZE");
230
   }
230
   }
231
 
231
 
232
   #if ENABLED(GCODE_QUOTED_STRINGS)
232
   #if ENABLED(GCODE_QUOTED_STRINGS)

+ 1
- 1
Marlin/src/inc/Conditionals_post.h Wyświetl plik

125
   #if EITHER(IS_CORE, MARKFORGED_XY)
125
   #if EITHER(IS_CORE, MARKFORGED_XY)
126
     #define CAN_CALIBRATE(A,B) (_AXIS(A) == B)
126
     #define CAN_CALIBRATE(A,B) (_AXIS(A) == B)
127
   #else
127
   #else
128
-    #define CAN_CALIBRATE(A,B) 1
128
+    #define CAN_CALIBRATE(A,B) true
129
   #endif
129
   #endif
130
 #endif
130
 #endif
131
 #define AXIS_CAN_CALIBRATE(A) CAN_CALIBRATE(A,NORMAL_AXIS)
131
 #define AXIS_CAN_CALIBRATE(A) CAN_CALIBRATE(A,NORMAL_AXIS)

+ 1
- 1
Marlin/src/inc/SanityCheck.h Wyświetl plik

3247
 /**
3247
 /**
3248
  * Sanity check for MIXING_EXTRUDER & DISTINCT_E_FACTORS these are not compatible
3248
  * Sanity check for MIXING_EXTRUDER & DISTINCT_E_FACTORS these are not compatible
3249
  */
3249
  */
3250
-#if ENABLED(MIXING_EXTRUDER) && ENABLED(DISTINCT_E_FACTORS)
3250
+#if BOTH(MIXING_EXTRUDER, DISTINCT_E_FACTORS)
3251
   #error "MIXING_EXTRUDER can't be used with DISTINCT_E_FACTORS. But you may use SINGLENOZZLE with DISTINCT_E_FACTORS."
3251
   #error "MIXING_EXTRUDER can't be used with DISTINCT_E_FACTORS. But you may use SINGLENOZZLE with DISTINCT_E_FACTORS."
3252
 #endif
3252
 #endif
3253
 
3253
 

+ 1
- 0
Marlin/src/lcd/extui/dgus/dgus_extui.cpp Wyświetl plik

147
         case PID_DONE:
147
         case PID_DONE:
148
           ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
148
           ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
149
           break;
149
           break;
150
+        case PID_STARTED: break;
150
       }
151
       }
151
       ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
152
       ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
152
     }
153
     }

+ 6
- 6
Marlin/src/lcd/extui/ui_api.cpp Wyświetl plik

569
   }
569
   }
570
 
570
 
571
   float getAxisSteps_per_mm(const extruder_t extruder) {
571
   float getAxisSteps_per_mm(const extruder_t extruder) {
572
-    UNUSED_E(extruder);
572
+    UNUSED(extruder);
573
     return planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)];
573
     return planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)];
574
   }
574
   }
575
 
575
 
579
   }
579
   }
580
 
580
 
581
   void setAxisSteps_per_mm(const_float_t value, const extruder_t extruder) {
581
   void setAxisSteps_per_mm(const_float_t value, const extruder_t extruder) {
582
-    UNUSED_E(extruder);
582
+    UNUSED(extruder);
583
     planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)] = value;
583
     planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)] = value;
584
     planner.refresh_positioning();
584
     planner.refresh_positioning();
585
   }
585
   }
589
   }
589
   }
590
 
590
 
591
   feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t extruder) {
591
   feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t extruder) {
592
-    UNUSED_E(extruder);
592
+    UNUSED(extruder);
593
     return planner.settings.max_feedrate_mm_s[E_AXIS_N(extruder - E0)];
593
     return planner.settings.max_feedrate_mm_s[E_AXIS_N(extruder - E0)];
594
   }
594
   }
595
 
595
 
598
   }
598
   }
599
 
599
 
600
   void setAxisMaxFeedrate_mm_s(const feedRate_t value, const extruder_t extruder) {
600
   void setAxisMaxFeedrate_mm_s(const feedRate_t value, const extruder_t extruder) {
601
-    UNUSED_E(extruder);
601
+    UNUSED(extruder);
602
     planner.set_max_feedrate(E_AXIS_N(extruder - E0), value);
602
     planner.set_max_feedrate(E_AXIS_N(extruder - E0), value);
603
   }
603
   }
604
 
604
 
607
   }
607
   }
608
 
608
 
609
   float getAxisMaxAcceleration_mm_s2(const extruder_t extruder) {
609
   float getAxisMaxAcceleration_mm_s2(const extruder_t extruder) {
610
-    UNUSED_E(extruder);
610
+    UNUSED(extruder);
611
     return planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)];
611
     return planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)];
612
   }
612
   }
613
 
613
 
616
   }
616
   }
617
 
617
 
618
   void setAxisMaxAcceleration_mm_s2(const_float_t value, const extruder_t extruder) {
618
   void setAxisMaxAcceleration_mm_s2(const_float_t value, const extruder_t extruder) {
619
-    UNUSED_E(extruder);
619
+    UNUSED(extruder);
620
     planner.set_max_acceleration(E_AXIS_N(extruder - E0), value);
620
     planner.set_max_acceleration(E_AXIS_N(extruder - E0), value);
621
   }
621
   }
622
 
622
 

+ 1
- 2
Marlin/src/lcd/menu/menu_mmu2.cpp Wyświetl plik

37
   ui.reset_status();
37
   ui.reset_status();
38
   ui.return_to_status();
38
   ui.return_to_status();
39
   ui.status_printf_P(0,  GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(tool + 1));
39
   ui.status_printf_P(0,  GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(tool + 1));
40
-  if (mmu2.load_filament_to_nozzle(tool))
41
-    ui.reset_status();
40
+  if (mmu2.load_filament_to_nozzle(tool)) ui.reset_status();
42
   ui.return_to_status();
41
   ui.return_to_status();
43
 }
42
 }
44
 
43
 

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

508
   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
508
   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
509
   #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT))
509
   #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT))
510
 
510
 
511
-  #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
511
+  #if BOTH(G38_PROBE_TARGET, HAS_Z_MIN_PROBE_PIN) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
512
     // If G38 command is active check Z_MIN_PROBE for ALL movement
512
     // If G38 command is active check Z_MIN_PROBE for ALL movement
513
     if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
513
     if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
514
   #endif
514
   #endif
747
     #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
747
     #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
748
   #endif
748
   #endif
749
 
749
 
750
-  #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
750
+  #if BOTH(G38_PROBE_TARGET, HAS_Z_MIN_PROBE_PIN) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
751
     #if ENABLED(G38_PROBE_AWAY)
751
     #if ENABLED(G38_PROBE_AWAY)
752
       #define _G38_OPEN_STATE (G38_move >= 4)
752
       #define _G38_OPEN_STATE (G38_move >= 4)
753
     #else
753
     #else

+ 8
- 12
Marlin/src/module/motion.cpp Wyświetl plik

83
  *   Used by 'line_to_current_position' to do a move after changing it.
83
  *   Used by 'line_to_current_position' to do a move after changing it.
84
  *   Used by 'sync_plan_position' to update 'planner.position'.
84
  *   Used by 'sync_plan_position' to update 'planner.position'.
85
  */
85
  */
86
-xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS,
87
-  #ifdef Z_IDLE_HEIGHT
88
-    Z_IDLE_HEIGHT
89
-  #else
90
-    Z_HOME_POS
91
-  #endif
92
-};
86
+#ifdef Z_IDLE_HEIGHT
87
+  #define Z_INIT_POS Z_IDLE_HEIGHT
88
+#else
89
+  #define Z_INIT_POS Z_HOME_POS
90
+#endif
91
+
92
+xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS, Z_INIT_POS };
93
 
93
 
94
 /**
94
 /**
95
  * Cartesian Destination
95
  * Cartesian Destination
204
   get_cartesian_from_steppers();
204
   get_cartesian_from_steppers();
205
   xyze_pos_t npos = cartes;
205
   xyze_pos_t npos = cartes;
206
   npos.e = planner.get_axis_position_mm(E_AXIS);
206
   npos.e = planner.get_axis_position_mm(E_AXIS);
207
-
208
-  #if HAS_POSITION_MODIFIERS
209
-    planner.unapply_modifiers(npos, true);
210
-  #endif
211
-
207
+  TERN_(HAS_POSITION_MODIFIERS, planner.unapply_modifiers(npos, true));
212
   report_logical_position(npos);
208
   report_logical_position(npos);
213
   report_more_positions();
209
   report_more_positions();
214
 }
210
 }

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

2584
 void MarlinSettings::reset() {
2584
 void MarlinSettings::reset() {
2585
   LOOP_XYZE_N(i) {
2585
   LOOP_XYZE_N(i) {
2586
     planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&_DMA[ALIM(i, _DMA)]);
2586
     planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&_DMA[ALIM(i, _DMA)]);
2587
-    planner.settings.axis_steps_per_mm[i]          = pgm_read_float(&_DASU[ALIM(i, _DASU)]);
2588
-    planner.settings.max_feedrate_mm_s[i]          = pgm_read_float(&_DMF[ALIM(i, _DMF)]);
2587
+    planner.settings.axis_steps_per_mm[i] = pgm_read_float(&_DASU[ALIM(i, _DASU)]);
2588
+    planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&_DMF[ALIM(i, _DMF)]);
2589
   }
2589
   }
2590
 
2590
 
2591
   planner.settings.min_segment_time_us = DEFAULT_MINSEGMENTTIME;
2591
   planner.settings.min_segment_time_us = DEFAULT_MINSEGMENTTIME;

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

62
 #define _TMC_UART_DEFINE(SWHW, IC, ST, AI) TMC_UART_##SWHW##_DEFINE(IC, ST, TMC_##ST##_LABEL, AI)
62
 #define _TMC_UART_DEFINE(SWHW, IC, ST, AI) TMC_UART_##SWHW##_DEFINE(IC, ST, TMC_##ST##_LABEL, AI)
63
 #define TMC_UART_DEFINE(SWHW, ST, AI) _TMC_UART_DEFINE(SWHW, ST##_DRIVER_TYPE, ST, AI##_AXIS)
63
 #define TMC_UART_DEFINE(SWHW, ST, AI) _TMC_UART_DEFINE(SWHW, ST##_DRIVER_TYPE, ST, AI##_AXIS)
64
 
64
 
65
-#if DISTINCT_E > 1
65
+#if ENABLED(DISTINCT_E_FACTORS)
66
   #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E##AI)
66
   #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E##AI)
67
   #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E##AI)
67
   #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E##AI)
68
 #else
68
 #else

Ładowanie…
Anuluj
Zapisz