Browse Source

Ensble/disable hardware endstops in G28 globally.

For moving away from the endstops we do not have to disable them.
They are not tested anyway.
AnHardt 9 years ago
parent
commit
eff7912243
1 changed files with 9 additions and 29 deletions
  1. 9
    29
      Marlin/Marlin_main.cpp

+ 9
- 29
Marlin/Marlin_main.cpp View File

2390
     current_position[axis] = 0;
2390
     current_position[axis] = 0;
2391
     sync_plan_position();
2391
     sync_plan_position();
2392
 
2392
 
2393
-    #if ENABLED(DEBUG_LEVELING_FEATURE)
2394
-      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)");
2395
-    #endif
2396
-    endstops.enable(false); // Disable endstops while moving away
2397
-
2398
     // Move away from the endstop by the axis HOME_BUMP_MM
2393
     // Move away from the endstop by the axis HOME_BUMP_MM
2399
     destination[axis] = -home_bump_mm(axis) * axis_home_dir;
2394
     destination[axis] = -home_bump_mm(axis) * axis_home_dir;
2400
     line_to_destination();
2395
     line_to_destination();
2401
     stepper.synchronize();
2396
     stepper.synchronize();
2402
 
2397
 
2403
-    #if ENABLED(DEBUG_LEVELING_FEATURE)
2404
-      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
2405
-    #endif
2406
-    endstops.enable(true); // Enable endstops for next homing move
2407
-
2408
     // Slow down the feedrate for the next move
2398
     // Slow down the feedrate for the next move
2409
     set_homing_bump_feedrate(axis);
2399
     set_homing_bump_feedrate(axis);
2410
 
2400
 
2445
     #if ENABLED(DELTA)
2435
     #if ENABLED(DELTA)
2446
       // retrace by the amount specified in endstop_adj
2436
       // retrace by the amount specified in endstop_adj
2447
       if (endstop_adj[axis] * axis_home_dir < 0) {
2437
       if (endstop_adj[axis] * axis_home_dir < 0) {
2448
-        #if ENABLED(DEBUG_LEVELING_FEATURE)
2449
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)");
2450
-        #endif
2451
-        endstops.enable(false); // Disable endstops while moving away
2452
         sync_plan_position();
2438
         sync_plan_position();
2453
         destination[axis] = endstop_adj[axis];
2439
         destination[axis] = endstop_adj[axis];
2454
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2440
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2459
         #endif
2445
         #endif
2460
         line_to_destination();
2446
         line_to_destination();
2461
         stepper.synchronize();
2447
         stepper.synchronize();
2462
-        #if ENABLED(DEBUG_LEVELING_FEATURE)
2463
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
2464
-        #endif
2465
-        endstops.enable(true); // Enable endstops for next homing move
2466
       }
2448
       }
2467
-      #if ENABLED(DEBUG_LEVELING_FEATURE)
2468
-        else {
2469
-          if (DEBUGGING(LEVELING)) {
2470
-            SERIAL_ECHOPAIR("> endstop_adj * axis_home_dir = ", endstop_adj[axis] * axis_home_dir);
2471
-            SERIAL_EOL;
2472
-          }
2473
-        }
2474
-      #endif
2475
     #endif
2449
     #endif
2476
 
2450
 
2477
     // Set the axis position to its home position (plus home offsets)
2451
     // Set the axis position to its home position (plus home offsets)
2840
   #endif
2814
   #endif
2841
 
2815
 
2842
   setup_for_endstop_or_probe_move();
2816
   setup_for_endstop_or_probe_move();
2843
-  endstops.enable();
2817
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
2818
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
2819
+  #endif
2820
+  endstops.enable(true); // Enable endstops for next homing move
2821
+
2844
 
2822
 
2845
   #if ENABLED(DELTA)
2823
   #if ENABLED(DELTA)
2846
     /**
2824
     /**
3061
 
3039
 
3062
   #endif // !DELTA (gcode_G28)
3040
   #endif // !DELTA (gcode_G28)
3063
 
3041
 
3042
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
3043
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.not_homing()");
3044
+  #endif
3064
   endstops.not_homing();
3045
   endstops.not_homing();
3046
+  endstops.hit_on_purpose(); // clear endstop hit flags
3065
 
3047
 
3066
   // Enable mesh leveling again
3048
   // Enable mesh leveling again
3067
   #if ENABLED(MESH_BED_LEVELING)
3049
   #if ENABLED(MESH_BED_LEVELING)
3101
 
3083
 
3102
   clean_up_after_endstop_or_probe_move();
3084
   clean_up_after_endstop_or_probe_move();
3103
 
3085
 
3104
-  endstops.hit_on_purpose(); // clear endstop hit flags
3105
-
3106
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3086
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3107
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28");
3087
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28");
3108
   #endif
3088
   #endif

Loading…
Cancel
Save