Browse Source

🎨 Apply more HAS_DELTA_SENSORLESS_PROBING

Scott Lahteine 3 years ago
parent
commit
08e581d5d7

+ 1
- 1
Marlin/src/gcode/calibrate/G33.cpp View File

425
 
425
 
426
   const bool stow_after_each = parser.seen_test('E');
426
   const bool stow_after_each = parser.seen_test('E');
427
 
427
 
428
-  #if ENABLED(SENSORLESS_PROBING)
428
+  #if HAS_DELTA_SENSORLESS_PROBING
429
     probe.test_sensitivity.x = !parser.seen_test('X');
429
     probe.test_sensitivity.x = !parser.seen_test('X');
430
     TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y'));
430
     TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y'));
431
     TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z'));
431
     TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z'));

+ 1
- 1
Marlin/src/module/delta.cpp View File

254
   current_position.z = DIFF_TERN(HAS_BED_PROBE, delta_height + 10, probe.offset.z);
254
   current_position.z = DIFF_TERN(HAS_BED_PROBE, delta_height + 10, probe.offset.z);
255
   line_to_current_position(homing_feedrate(Z_AXIS));
255
   line_to_current_position(homing_feedrate(Z_AXIS));
256
   planner.synchronize();
256
   planner.synchronize();
257
-  TERN_(SENSORLESS_PROBING,endstops.report_states());
257
+  TERN_(HAS_DELTA_SENSORLESS_PROBING, endstops.report_states());
258
 
258
 
259
   // Re-enable stealthChop if used. Disable diag1 pin on driver.
259
   // Re-enable stealthChop if used. Disable diag1 pin on driver.
260
   #if ENABLED(SENSORLESS_HOMING) && DISABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
260
   #if ENABLED(SENSORLESS_HOMING) && DISABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)

+ 1
- 1
Marlin/src/module/endstops.cpp View File

595
 // The following routines are called from an ISR context. It could be the temperature ISR, the
595
 // The following routines are called from an ISR context. It could be the temperature ISR, the
596
 // endstop ISR or the Stepper ISR.
596
 // endstop ISR or the Stepper ISR.
597
 
597
 
598
-#if BOTH(DELTA, SENSORLESS_PROBING)
598
+#if HAS_DELTA_SENSORLESS_PROBING
599
   #define __ENDSTOP(AXIS, ...) AXIS ##_MAX
599
   #define __ENDSTOP(AXIS, ...) AXIS ##_MAX
600
   #define _ENDSTOP_PIN(AXIS, ...) AXIS ##_MAX_PIN
600
   #define _ENDSTOP_PIN(AXIS, ...) AXIS ##_MAX_PIN
601
   #define _ENDSTOP_INVERTING(AXIS, ...) AXIS ##_MAX_ENDSTOP_INVERTING
601
   #define _ENDSTOP_INVERTING(AXIS, ...) AXIS ##_MAX_ENDSTOP_INVERTING

+ 7
- 7
Marlin/src/module/probe.cpp View File

493
   // Disable stealthChop if used. Enable diag1 pin on driver.
493
   // Disable stealthChop if used. Enable diag1 pin on driver.
494
   #if ENABLED(SENSORLESS_PROBING)
494
   #if ENABLED(SENSORLESS_PROBING)
495
     sensorless_t stealth_states { false };
495
     sensorless_t stealth_states { false };
496
-    #if ENABLED(DELTA)
496
+    #if HAS_DELTA_SENSORLESS_PROBING
497
       if (probe.test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX);  // Delta watches all DIAG pins for a stall
497
       if (probe.test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX);  // Delta watches all DIAG pins for a stall
498
       if (probe.test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY);
498
       if (probe.test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY);
499
     #endif
499
     #endif
509
 
509
 
510
   // Check to see if the probe was triggered
510
   // Check to see if the probe was triggered
511
   const bool probe_triggered =
511
   const bool probe_triggered =
512
-    #if BOTH(DELTA, SENSORLESS_PROBING)
512
+    #if HAS_DELTA_SENSORLESS_PROBING
513
       endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX))
513
       endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX))
514
     #else
514
     #else
515
       TEST(endstops.trigger_state(), Z_MIN_PROBE)
515
       TEST(endstops.trigger_state(), Z_MIN_PROBE)
521
   // Re-enable stealthChop if used. Disable diag1 pin on driver.
521
   // Re-enable stealthChop if used. Disable diag1 pin on driver.
522
   #if ENABLED(SENSORLESS_PROBING)
522
   #if ENABLED(SENSORLESS_PROBING)
523
     endstops.not_homing();
523
     endstops.not_homing();
524
-    #if ENABLED(DELTA)
524
+    #if HAS_DELTA_SENSORLESS_PROBING
525
       if (probe.test_sensitivity.x) tmc_disable_stallguard(stepperX, stealth_states.x);
525
       if (probe.test_sensitivity.x) tmc_disable_stallguard(stepperX, stealth_states.x);
526
       if (probe.test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y);
526
       if (probe.test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y);
527
     #endif
527
     #endif
765
   #endif
765
   #endif
766
 
766
 
767
   // On delta keep Z below clip height or do_blocking_move_to will abort
767
   // On delta keep Z below clip height or do_blocking_move_to will abort
768
-  xyz_pos_t npos = { rx, ry, _MIN(TERN(DELTA, delta_clip_start_height, current_position.z), current_position.z) };
768
+  xyz_pos_t npos = { rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z) };
769
   if (probe_relative) {                                     // The given position is in terms of the probe
769
   if (probe_relative) {                                     // The given position is in terms of the probe
770
     if (!can_reach(npos)) {
770
     if (!can_reach(npos)) {
771
       if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
771
       if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
827
    */
827
    */
828
   void Probe::enable_stallguard_diag1() {
828
   void Probe::enable_stallguard_diag1() {
829
     #if ENABLED(SENSORLESS_PROBING)
829
     #if ENABLED(SENSORLESS_PROBING)
830
-      #if ENABLED(DELTA)
830
+      #if HAS_DELTA_SENSORLESS_PROBING
831
         stealth_states.x = tmc_enable_stallguard(stepperX);
831
         stealth_states.x = tmc_enable_stallguard(stepperX);
832
         stealth_states.y = tmc_enable_stallguard(stepperY);
832
         stealth_states.y = tmc_enable_stallguard(stepperY);
833
       #endif
833
       #endif
842
   void Probe::disable_stallguard_diag1() {
842
   void Probe::disable_stallguard_diag1() {
843
     #if ENABLED(SENSORLESS_PROBING)
843
     #if ENABLED(SENSORLESS_PROBING)
844
       endstops.not_homing();
844
       endstops.not_homing();
845
-      #if ENABLED(DELTA)
845
+      #if HAS_DELTA_SENSORLESS_PROBING
846
         tmc_disable_stallguard(stepperX, stealth_states.x);
846
         tmc_disable_stallguard(stepperX, stealth_states.x);
847
         tmc_disable_stallguard(stepperY, stealth_states.y);
847
         tmc_disable_stallguard(stepperY, stealth_states.y);
848
       #endif
848
       #endif
907
     #endif
907
     #endif
908
   }
908
   }
909
 
909
 
910
-#endif // SENSORLESS_PROBING
910
+#endif // SENSORLESS_PROBING || SENSORLESS_HOMING
911
 
911
 
912
 #endif // HAS_BED_PROBE
912
 #endif // HAS_BED_PROBE

Loading…
Cancel
Save