Explorar el Código

🧑‍💻 Combined axis strings

Scott Lahteine hace 2 años
padre
commit
31413a7d77

+ 2
- 2
Marlin/src/core/types.h Ver fichero

@@ -47,6 +47,7 @@ struct IF<true, L, R> { typedef L type; };
47 47
 #define NUM_AXIS_DEFS(T,V)  NUM_AXIS_LIST(T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V)
48 48
 #define MAIN_AXIS_NAMES     NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W)
49 49
 #define MAIN_AXIS_MAP(F)    MAP(F, MAIN_AXIS_NAMES)
50
+#define STR_AXES_MAIN       NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
50 51
 
51 52
 #define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E)
52 53
 #define LOGICAL_AXIS_CODE(E,V...) NUM_AXIS_CODE(V) CODE_ITEM_E(E)
@@ -59,8 +60,7 @@ struct IF<true, L, R> { typedef L type; };
59 60
 #define LOGICAL_AXIS_DECL(T,V)  LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V)
60 61
 #define LOGICAL_AXIS_NAMES      LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K, U, V, W)
61 62
 #define LOGICAL_AXIS_MAP(F)     MAP(F, LOGICAL_AXIS_NAMES)
62
-
63
-#define LOGICAL_AXES_STRING LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
63
+#define STR_AXES_LOGICAL     LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
64 64
 
65 65
 #define XYZ_GANG(V...) GANG_N(PRIMARY_LINEAR_AXES, V)
66 66
 #define XYZ_CODE(V...) CODE_N(PRIMARY_LINEAR_AXES, V)

+ 2
- 2
Marlin/src/gcode/config/M200-M205.cpp Ver fichero

@@ -113,7 +113,7 @@
113 113
  *       With multiple extruders use T to specify which one.
114 114
  */
115 115
 void GcodeSuite::M201() {
116
-  if (!parser.seen("T" LOGICAL_AXES_STRING))
116
+  if (!parser.seen("T" STR_AXES_LOGICAL))
117 117
     return M201_report();
118 118
 
119 119
   const int8_t target_extruder = get_target_extruder_from_command();
@@ -167,7 +167,7 @@ void GcodeSuite::M201_report(const bool forReplay/*=true*/) {
167 167
  *       With multiple extruders use T to specify which one.
168 168
  */
169 169
 void GcodeSuite::M203() {
170
-  if (!parser.seen("T" LOGICAL_AXES_STRING))
170
+  if (!parser.seen("T" STR_AXES_LOGICAL))
171 171
     return M203_report();
172 172
 
173 173
   const int8_t target_extruder = get_target_extruder_from_command();

+ 1
- 1
Marlin/src/gcode/config/M92.cpp Ver fichero

@@ -43,7 +43,7 @@ void GcodeSuite::M92() {
43 43
   if (target_extruder < 0) return;
44 44
 
45 45
   // No arguments? Show M92 report.
46
-  if (!parser.seen(LOGICAL_AXES_STRING TERN_(MAGIC_NUMBERS_GCODE, "HL")))
46
+  if (!parser.seen(STR_AXES_LOGICAL TERN_(MAGIC_NUMBERS_GCODE, "HL")))
47 47
     return M92_report(true, target_extruder);
48 48
 
49 49
   LOOP_LOGICAL_AXES(i) {

+ 1
- 1
Marlin/src/gcode/feature/digipot/M907-M910.cpp Ver fichero

@@ -48,7 +48,7 @@
48 48
 void GcodeSuite::M907() {
49 49
   #if HAS_MOTOR_CURRENT_SPI
50 50
 
51
-    if (!parser.seen("BS" LOGICAL_AXES_STRING))
51
+    if (!parser.seen("BS" STR_AXES_LOGICAL))
52 52
       return M907_report();
53 53
 
54 54
     if (parser.seenval('S')) LOOP_L_N(i, MOTOR_CURRENT_COUNT) stepper.set_digipot_current(i, parser.value_int());

+ 1
- 1
Marlin/src/gcode/feature/pause/G61.cpp Ver fichero

@@ -68,7 +68,7 @@ void GcodeSuite::G61() {
68 68
     SYNC_E(stored_position[slot].e);
69 69
   }
70 70
   else {
71
-    if (parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W))) {
71
+    if (parser.seen(STR_AXES_MAIN)) {
72 72
       DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot);
73 73
       LOOP_NUM_AXES(i) {
74 74
         destination[i] = parser.seenval(AXIS_CHAR(i))

+ 1
- 1
Marlin/src/gcode/motion/G0_G1.cpp Ver fichero

@@ -92,7 +92,7 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
92 92
       if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
93 93
         // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
94 94
         if (fwretract.autoretract_enabled && parser.seen_test('E')
95
-          && !parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W))
95
+          && !parser.seen(STR_AXES_MAIN)
96 96
         ) {
97 97
           const float echange = destination.e - current_position.e;
98 98
           // Is this a retract or recover move?

+ 1
- 1
Marlin/src/gcode/motion/M290.cpp Ver fichero

@@ -87,7 +87,7 @@ void GcodeSuite::M290() {
87 87
     }
88 88
   #endif
89 89
 
90
-  if (!parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)) || parser.seen('R')) {
90
+  if (!parser.seen(STR_AXES_MAIN) || parser.seen('R')) {
91 91
     SERIAL_ECHO_START();
92 92
 
93 93
     #if ENABLED(BABYSTEP_ZPROBE_OFFSET)

+ 1
- 1
Marlin/src/gcode/parser.h Ver fichero

@@ -225,7 +225,7 @@ public:
225 225
   #endif // !FASTER_GCODE_PARSER
226 226
 
227 227
   // Seen any axis parameter
228
-  static bool seen_axis() { return seen(LOGICAL_AXES_STRING); }
228
+  static bool seen_axis() { return seen(STR_AXES_LOGICAL); }
229 229
 
230 230
   #if ENABLED(GCODE_QUOTED_STRINGS)
231 231
     static char* unescape_string(char* &src);

Loading…
Cancelar
Guardar