🧑‍💻 Add AXIS_COLLISION to catch broken parameters

\
This commit is contained in:
Scott Lahteine 2021-12-28 05:02:40 -06:00 committed by Scott Lahteine
parent 99c237e05e
commit 5d7328df46
5 changed files with 15 additions and 1 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -24,6 +24,10 @@
#if ENABLED(BEZIER_CURVE_SUPPORT) #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/motion.h"
#include "../../module/planner_bezier.h" #include "../../module/planner_bezier.h"