Browse Source

Add HAS_FAST_MOVES

Scott Lahteine 3 years ago
parent
commit
fb7d7ee7b4
3 changed files with 10 additions and 22 deletions
  1. 4
    12
      Marlin/src/gcode/gcode.cpp
  2. 5
    5
      Marlin/src/gcode/gcode.h
  3. 1
    5
      Marlin/src/gcode/motion/G0_G1.cpp

+ 4
- 12
Marlin/src/gcode/gcode.cpp View File

260
   switch (parser.command_letter) {
260
   switch (parser.command_letter) {
261
     case 'G': switch (parser.codenum) {
261
     case 'G': switch (parser.codenum) {
262
 
262
 
263
-      case 0: case 1: G0_G1(                                      // G0: Fast Move, G1: Linear Move
264
-                        #if IS_SCARA || defined(G0_FEEDRATE)
265
-                          parser.codenum == 0
266
-                        #endif
267
-                      );
268
-                      break;
263
+      case 0: case 1:                                             // G0: Fast Move, G1: Linear Move
264
+        G0_G1(TERN_(HAS_FAST_MOVES, parser.codenum == 0)); break;
269
 
265
 
270
       #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
266
       #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
271
         case 2: case 3: G2_G3(parser.codenum == 2); break;        // G2: CW ARC, G3: CCW ARC
267
         case 2: case 3: G2_G3(parser.codenum == 2); break;        // G2: CW ARC, G3: CCW ARC
315
 
311
 
316
       #if HAS_LEVELING
312
       #if HAS_LEVELING
317
         case 29:                                                  // G29: Bed leveling calibration
313
         case 29:                                                  // G29: Bed leveling calibration
318
-          #if ENABLED(G29_RETRY_AND_RECOVER)
319
-            G29_with_retry();
320
-          #else
321
-            G29();
322
-          #endif
314
+          TERN(G29_RETRY_AND_RECOVER, G29_with_retry, G29)();
323
           break;
315
           break;
324
-      #endif // HAS_LEVELING
316
+      #endif
325
 
317
 
326
       #if HAS_BED_PROBE
318
       #if HAS_BED_PROBE
327
         case 30: G30(); break;                                    // G30: Single Z probe
319
         case 30: G30(); break;                                    // G30: Single Z probe

+ 5
- 5
Marlin/src/gcode/gcode.h View File

298
   #include "../feature/encoder_i2c.h"
298
   #include "../feature/encoder_i2c.h"
299
 #endif
299
 #endif
300
 
300
 
301
+#if IS_SCARA || defined(G0_FEEDRATE)
302
+  #define HAS_FAST_MOVES 1
303
+#endif
304
+
301
 enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL };
305
 enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL };
302
 
306
 
303
 class GcodeSuite {
307
 class GcodeSuite {
404
 
408
 
405
 private:
409
 private:
406
 
410
 
407
-  static void G0_G1(
408
-    #if IS_SCARA || defined(G0_FEEDRATE)
409
-      const bool fast_move=false
410
-    #endif
411
-  );
411
+  static void G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move=false));
412
 
412
 
413
   TERN_(ARC_SUPPORT, static void G2_G3(const bool clockwise));
413
   TERN_(ARC_SUPPORT, static void G2_G3(const bool clockwise));
414
 
414
 

+ 1
- 5
Marlin/src/gcode/motion/G0_G1.cpp View File

44
 /**
44
 /**
45
  * G0, G1: Coordinated movement of X Y Z E axes
45
  * G0, G1: Coordinated movement of X Y Z E axes
46
  */
46
  */
47
-void GcodeSuite::G0_G1(
48
-  #if IS_SCARA || defined(G0_FEEDRATE)
49
-    const bool fast_move/*=false*/
50
-  #endif
51
-) {
47
+void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
52
 
48
 
53
   if (IsRunning()
49
   if (IsRunning()
54
     #if ENABLED(NO_MOTION_BEFORE_HOMING)
50
     #if ENABLED(NO_MOTION_BEFORE_HOMING)

Loading…
Cancel
Save