Browse Source

Ensure TMC + LIN_ADVANCE pulse length (#15807)

ManuelMcLure 5 years ago
parent
commit
b9703fdf36
3 changed files with 27 additions and 2 deletions
  1. 13
    0
      Marlin/src/core/drivers.h
  2. 6
    2
      Marlin/src/inc/Conditionals_post.h
  3. 8
    0
      Marlin/src/inc/SanityCheck.h

+ 13
- 0
Marlin/src/core/drivers.h View File

@@ -121,6 +121,19 @@
121 121
                                    || AXIS_DRIVER_TYPE(A,TMC5130) \
122 122
                                    || AXIS_DRIVER_TYPE(A,TMC5160) )
123 123
 
124
+#define HAS_TMC_E_DRIVER (    HAS_E_DRIVER(TMC2130) \
125
+                           || HAS_E_DRIVER(TMC2160) \
126
+                           || HAS_E_DRIVER(TMC2660) \
127
+                           || HAS_E_DRIVER(TMC2209) \
128
+                           || HAS_E_DRIVER(TMC5130) \
129
+                           || HAS_E_DRIVER(TMC5160) )
130
+
131
+#define HAS_TMC_STANDALONE_E_DRIVER  (    HAS_E_DRIVER(TMC2130_STANDALONE) \
132
+                                       || HAS_E_DRIVER(TMC2160_STANDALONE) \
133
+                                       || HAS_E_DRIVER(TMC2660_STANDALONE) \
134
+                                       || HAS_E_DRIVER(TMC2209_STANDALONE) \
135
+                                       || HAS_E_DRIVER(TMC5130_STANDALONE) \
136
+                                       || HAS_E_DRIVER(TMC5160_STANDALONE) )                   
124 137
 //
125 138
 // Stretching 'drivers.h' to include LPC/SAMD51 SD options
126 139
 //

+ 6
- 2
Marlin/src/inc/Conditionals_post.h View File

@@ -578,9 +578,13 @@
578 578
     #define MINIMUM_STEPPER_PULSE 2
579 579
   #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
580 580
     #define MINIMUM_STEPPER_PULSE 1
581
-  #elif HAS_DRIVER(LV8729)
582
-    #define MINIMUM_STEPPER_PULSE 0
583 581
   #elif TRINAMICS
582
+    #if ENABLED(LIN_ADVANCE) && (HAS_TMC_STANDALONE_E_DRIVER || (HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING)))
583
+      #define MINIMUM_STEPPER_PULSE 1
584
+    #else
585
+      #define MINIMUM_STEPPER_PULSE 0
586
+    #endif
587
+  #elif HAS_DRIVER(LV8729)
584 588
     #define MINIMUM_STEPPER_PULSE 0
585 589
   #else
586 590
     #define MINIMUM_STEPPER_PULSE 2

+ 8
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -2546,3 +2546,11 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2546 2546
     #error "SHOW_REMAINING_TIME currently requires a Graphical LCD."
2547 2547
   #endif
2548 2548
 #endif
2549
+
2550
+#if ENABLED(LIN_ADVANCE) && MINIMUM_STEPPER_PULSE < 1
2551
+  #if HAS_TMC_STANDALONE_E_DRIVER
2552
+    #error "LIN_ADVANCE with TMC standalone driver on extruder requires MIMIMUM_STEPPER_PULSE >= 1"
2553
+  #elif HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING)
2554
+    #error "LIN_ADVANCE with TMC driver on extruder requires SQUARE_WAVE_STEPPING or MINIMUM_STEPPER_PULSE >= 1"
2555
+  #endif
2556
+#endif

Loading…
Cancel
Save