Browse Source

Solve endstops issues (#12382)

- Partially reverts #11900 and tries to solve #12336
Giuliano Zaro 6 years ago
parent
commit
fd7fd55662
2 changed files with 17 additions and 19 deletions
  1. 3
    19
      Marlin/src/module/endstops.cpp
  2. 14
    0
      Marlin/src/module/motion.cpp

+ 3
- 19
Marlin/src/module/endstops.cpp View File

@@ -260,33 +260,19 @@ void Endstops::poll() {
260 260
 void Endstops::enable_globally(const bool onoff) {
261 261
   enabled_globally = enabled = onoff;
262 262
 
263
-  #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
264
-    update();
265
-  #endif
263
+  update();
266 264
 }
267 265
 
268 266
 // Enable / disable endstop checking
269 267
 void Endstops::enable(const bool onoff) {
270 268
   enabled = onoff;
271 269
 
272
-  #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
273
-    update();
274
-  #endif
270
+  update();
275 271
 }
276 272
 
277 273
 // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable
278 274
 void Endstops::not_homing() {
279 275
   enabled = enabled_globally;
280
-
281
-  // Still 'enabled'? Then endstops are always on and kept in sync.
282
-  // Otherwise reset 'live's variables to let axes move in both directions.
283
-  if (!enabled) {
284
-    #if ENDSTOP_NOISE_THRESHOLD
285
-      endstop_poll_count = 0;   // Stop filtering (MUST be done first to prevent race condition)
286
-      validated_live_state = 0;
287
-    #endif
288
-    live_state = 0;
289
-  }
290 276
 }
291 277
 
292 278
 #if ENABLED(VALIDATE_HOMING_ENDSTOPS)
@@ -302,9 +288,7 @@ void Endstops::not_homing() {
302 288
   void Endstops::enable_z_probe(const bool onoff) {
303 289
     z_probe_enabled = onoff;
304 290
 
305
-    #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
306
-      update();
307
-    #endif
291
+    update();
308 292
   }
309 293
 #endif
310 294
 

+ 14
- 0
Marlin/src/module/motion.cpp View File

@@ -1522,6 +1522,20 @@ void homeaxis(const AxisEnum axis) {
1522 1522
       }
1523 1523
     #endif
1524 1524
 
1525
+    // Reset flags for X, Y, Z motor locking
1526
+    switch (axis) {
1527
+      #if ENABLED(X_DUAL_ENDSTOPS)
1528
+        case X_AXIS:
1529
+      #endif
1530
+      #if ENABLED(Y_DUAL_ENDSTOPS)
1531
+        case Y_AXIS:
1532
+      #endif
1533
+      #if Z_MULTI_ENDSTOPS
1534
+        case Z_AXIS:
1535
+      #endif
1536
+      stepper.set_separate_multi_axis(false);
1537
+      default: break;
1538
+    }
1525 1539
   #endif
1526 1540
 
1527 1541
   #if IS_SCARA

Loading…
Cancel
Save