Browse Source

🧑‍💻 Add AXIS_COLLISION to catch broken parameters

\
vanilla_fb_2.0.x
Scott Lahteine 3 years ago
committed by Scott Lahteine
parent
commit
5d7328df46
  1. 2
      Marlin/src/core/types.h
  2. 2
      Marlin/src/gcode/config/M200-M205.cpp
  3. 4
      Marlin/src/gcode/feature/L6470/M906.cpp
  4. 4
      Marlin/src/gcode/feature/trinamic/M569.cpp
  5. 4
      Marlin/src/gcode/motion/G5.cpp

2
Marlin/src/core/types.h

@ -64,6 +64,8 @@ struct IF<true, L, R> { typedef L type; };
#define GANG_ITEM_E(N)
#endif
#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L)
//
// Enumerated axis indices
//

2
Marlin/src/gcode/config/M200-M205.cpp

@ -253,7 +253,7 @@ void GcodeSuite::M205() {
if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
#if HAS_JUNCTION_DEVIATION
#if HAS_CLASSIC_JERK && (AXIS4_NAME == 'J' || AXIS5_NAME == 'J' || AXIS6_NAME == 'J')
#if HAS_CLASSIC_JERK && AXIS_COLLISION('J')
#error "Can't set_max_jerk for 'J' axis because 'J' is used for Junction Deviation."
#endif
if (parser.seenval('J')) {

4
Marlin/src/gcode/feature/L6470/M906.cpp

@ -24,6 +24,10 @@
#if HAS_L64XX
#if AXIS_COLLISION('I')
#error "M906 parameter collision with axis name."
#endif
#include "../../gcode.h"
#include "../../../libs/L64XX/L64XX_Marlin.h"
#include "../../../module/stepper/indirection.h"

4
Marlin/src/gcode/feature/trinamic/M569.cpp

@ -24,6 +24,10 @@
#if HAS_STEALTHCHOP
#if AXIS_COLLISION('I')
#error "M569 parameter collision with axis name."
#endif
#include "../../gcode.h"
#include "../../../feature/tmc_util.h"
#include "../../../module/stepper/indirection.h"

4
Marlin/src/gcode/motion/G5.cpp

@ -24,6 +24,10 @@
#if ENABLED(BEZIER_CURVE_SUPPORT)
#if AXIS_COLLISION('I') || AXIS_COLLISION('J')
#error "G5 parameter collision with axis name."
#endif
#include "../../module/motion.h"
#include "../../module/planner_bezier.h"

Loading…
Cancel
Save