浏览代码

Patch G33 misuse of PROBE_MANUALLY

Scott Lahteine 7 年前
父节点
当前提交
82f45c3e6a

+ 17
- 17
Marlin/src/gcode/calibrate/G33.cpp 查看文件

@@ -153,7 +153,7 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
153 153
              _7p_6_centre         = probe_points >= 5 && probe_points <= 7,
154 154
              _7p_9_centre         = probe_points >= 8;
155 155
 
156
-  #if DISABLED(PROBE_MANUALLY)
156
+  #if HAS_BED_PROBE
157 157
     const float dx = (X_PROBE_OFFSET_FROM_EXTRUDER),
158 158
                 dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
159 159
   #endif
@@ -164,10 +164,10 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
164 164
 
165 165
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
166 166
       z_at_pt[CEN] +=
167
-        #if ENABLED(PROBE_MANUALLY)
168
-          lcd_probe_pt(0, 0)
169
-        #else
167
+        #if HAS_BED_PROBE
170 168
           probe_pt(dx, dy, stow_after_each, 1, false)
169
+        #else
170
+          lcd_probe_pt(0, 0)
171 171
         #endif
172 172
       ;
173 173
     }
@@ -179,10 +179,10 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
179 179
         const float a = RADIANS(210 + (360 / NPP) *  (axis - 1)),
180 180
                     r = delta_calibration_radius * 0.1;
181 181
         z_at_pt[CEN] +=
182
-          #if ENABLED(PROBE_MANUALLY)
183
-            lcd_probe_pt(cos(a) * r, sin(a) * r)
184
-          #else
182
+          #if HAS_BED_PROBE
185 183
             probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
184
+          #else
185
+            lcd_probe_pt(cos(a) * r, sin(a) * r)
186 186
           #endif
187 187
         ;
188 188
       }
@@ -208,10 +208,10 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
208 208
                       r = delta_calibration_radius * (1 + 0.1 * (zig_zag ? circle : - circle)),
209 209
                       interpol = FMOD(axis, 1);
210 210
           const float z_temp =
211
-            #if ENABLED(PROBE_MANUALLY)
212
-              lcd_probe_pt(cos(a) * r, sin(a) * r)
213
-            #else
211
+            #if HAS_BED_PROBE
214 212
               probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
213
+            #else
214
+              lcd_probe_pt(cos(a) * r, sin(a) * r)
215 215
             #endif
216 216
           ;
217 217
           // split probe point to neighbouring calibration points
@@ -242,7 +242,7 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
242 242
   return 0.00001;
243 243
 }
244 244
 
245
-#if DISABLED(PROBE_MANUALLY)
245
+#if HAS_BED_PROBE
246 246
 
247 247
   static void G33_auto_tune() {
248 248
     float z_at_pt[NPP + 1]      = { 0.0 },
@@ -366,7 +366,7 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
366 366
     SERIAL_EOL();
367 367
   }
368 368
 
369
-#endif // !PROBE_MANUALLY
369
+#endif // HAS_BED_PROBE
370 370
 
371 371
 /**
372 372
  * G33 - Delta '1-4-7-point' Auto-Calibration
@@ -488,10 +488,10 @@ void GcodeSuite::G33() {
488 488
   }
489 489
 
490 490
   if (auto_tune) {
491
-    #if ENABLED(PROBE_MANUALLY)
492
-      SERIAL_PROTOCOLLNPGM("A probe is needed for auto-tune");
493
-    #else
491
+    #if HAS_BED_PROBE
494 492
       G33_auto_tune();
493
+    #else
494
+      SERIAL_PROTOCOLLNPGM("A probe is needed for auto-tune");
495 495
     #endif
496 496
     G33_CLEANUP();
497 497
     return;
@@ -556,7 +556,7 @@ void GcodeSuite::G33() {
556 556
       #define Z2(I) ZP(2, I)
557 557
       #define Z1(I) ZP(1, I)
558 558
 
559
-      #if ENABLED(PROBE_MANUALLY)
559
+      #if !HAS_BED_PROBE
560 560
         test_precision = 0.00; // forced end
561 561
       #endif
562 562
 
@@ -638,7 +638,7 @@ void GcodeSuite::G33() {
638 638
       if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) {  // end iterations
639 639
         SERIAL_PROTOCOLPGM("Calibration OK");
640 640
         SERIAL_PROTOCOL_SP(32);
641
-        #if DISABLED(PROBE_MANUALLY)
641
+        #if HAS_BED_PROBE
642 642
           if (zero_std_dev >= test_precision && !_1p_calibration)
643 643
             SERIAL_PROTOCOLPGM("rolling back.");
644 644
           else

+ 1
- 1
Marlin/src/gcode/gcode.h 查看文件

@@ -379,7 +379,7 @@ private:
379 379
     #endif
380 380
   #endif
381 381
 
382
-  #if PROBE_SELECTED && ENABLED(DELTA_AUTO_CALIBRATION)
382
+  #if ENABLED(DELTA_AUTO_CALIBRATION)
383 383
     static void G33();
384 384
   #endif
385 385
 

+ 0
- 7
Marlin/src/inc/Conditionals_LCD.h 查看文件

@@ -469,13 +469,6 @@
469 469
 #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
470 470
 
471 471
 /**
472
- * UBL has its own manual probing, so this just causes trouble.
473
- */
474
-#if ENABLED(AUTO_BED_LEVELING_UBL)
475
-  #undef PROBE_MANUALLY
476
-#endif
477
-
478
-/**
479 472
  * Set a flag for any enabled probe
480 473
  */
481 474
 #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE))

+ 1
- 1
Marlin/src/inc/Conditionals_adv.h 查看文件

@@ -22,7 +22,7 @@
22 22
 
23 23
 /**
24 24
  * Conditionals_adv.h
25
- * Defines that depend on advanced onfiguration.
25
+ * Defines that depend on advanced configuration.
26 26
  */
27 27
 
28 28
 #ifndef CONDITIONALS_ADV_H

+ 0
- 5
Marlin/src/inc/Conditionals_post.h 查看文件

@@ -1114,11 +1114,6 @@
1114 1114
 // Add commands that need sub-codes to this list
1115 1115
 #define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS)
1116 1116
 
1117
-// MESH_BED_LEVELING overrides PROBE_MANUALLY
1118
-#if ENABLED(MESH_BED_LEVELING)
1119
-  #undef PROBE_MANUALLY
1120
-#endif
1121
-
1122 1117
 // Parking Extruder
1123 1118
 #if ENABLED(PARKING_EXTRUDER)
1124 1119
   #ifndef PARKING_EXTRUDER_GRAB_DISTANCE

+ 18
- 13
Marlin/src/inc/SanityCheck.h 查看文件

@@ -586,10 +586,8 @@ static_assert(1 >= 0
586 586
     #error "You probably want to use Max Endstops for DELTA!"
587 587
   #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_DELTA
588 588
     #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
589
-  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !PROBE_SELECTED
590
-    #error "DELTA_AUTO_CALIBRATION requires a probe: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, Z Servo."
591
-  #elif ENABLED(DELTA_AUTO_CALIBRATION) && ENABLED(PROBE_MANUALLY) && DISABLED(ULTIPANEL)
592
-    #error "DELTA_AUTO_CALIBRATION requires an LCD controller with PROBE_MANUALLY."
589
+  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL))
590
+    #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
593 591
   #elif ABL_GRID
594 592
     #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
595 593
       #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
@@ -631,7 +629,7 @@ static_assert(1 >= 0
631 629
   , "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
632 630
 );
633 631
 
634
-#if PROBE_SELECTED
632
+#if HAS_BED_PROBE
635 633
 
636 634
   /**
637 635
    * Z_PROBE_SLED is incompatible with DELTA
@@ -679,7 +677,7 @@ static_assert(1 >= 0
679 677
     #if !HAS_Z_MIN_PROBE_PIN
680 678
       #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined."
681 679
     #endif
682
-  #elif DISABLED(PROBE_MANUALLY)
680
+  #else
683 681
     #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe."
684 682
   #endif
685 683
 
@@ -701,14 +699,14 @@ static_assert(1 >= 0
701 699
   /**
702 700
    * Require some kind of probe for bed leveling and probe testing
703 701
    */
704
-  #if OLDSCHOOL_ABL
702
+  #if OLDSCHOOL_ABL && !PROBE_SELECTED
705 703
     #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
706 704
   #endif
707 705
 
708
-#endif
706
+  #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
707
+    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
708
+  #endif
709 709
 
710
-#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) && !HAS_BED_PROBE
711
-  #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
712 710
 #endif
713 711
 
714 712
 /**
@@ -743,6 +741,9 @@ static_assert(1 >= 0
743 741
    * Unified Bed Leveling
744 742
    */
745 743
 
744
+  // Hide PROBE_MANUALLY from the rest of the code
745
+  #undef PROBE_MANUALLY
746
+
746 747
   #if IS_SCARA
747 748
     #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
748 749
   #elif DISABLED(EEPROM_SETTINGS)
@@ -760,7 +761,8 @@ static_assert(1 >= 0
760 761
   #if ENABLED(ENABLE_MESH_EDIT_GFX_OVERLAY) && !ENABLED(DOGLCD)
761 762
     #error "ENABLE_MESH_EDIT_GFX_OVERLAY requires a DOGLCD."
762 763
   #endif
763
-#elif HAS_ABL
764
+
765
+#elif OLDSCHOOL_ABL
764 766
 
765 767
   /**
766 768
    * Auto Bed Leveling
@@ -809,6 +811,9 @@ static_assert(1 >= 0
809 811
 
810 812
 #elif ENABLED(MESH_BED_LEVELING)
811 813
 
814
+  // Hide PROBE_MANUALLY from the rest of the code
815
+  #undef PROBE_MANUALLY
816
+
812 817
   /**
813 818
    * Mesh Bed Leveling
814 819
    */
@@ -827,8 +832,8 @@ static_assert(1 >= 0
827 832
 #if ENABLED(LCD_BED_LEVELING)
828 833
   #if DISABLED(ULTIPANEL)
829 834
     #error "LCD_BED_LEVELING requires an LCD controller."
830
-  #elif DISABLED(MESH_BED_LEVELING) && !(HAS_ABL && ENABLED(PROBE_MANUALLY))
831
-    #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or PROBE_MANUALLY with auto bed leveling enabled."
835
+  #elif !(ENABLED(MESH_BED_LEVELING) || (OLDSCHOOL_ABL && ENABLED(PROBE_MANUALLY)))
836
+    #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or ABL with PROBE_MANUALLY."
832 837
   #endif
833 838
 #endif
834 839
 

+ 27
- 20
Marlin/src/lcd/ultralcd.cpp 查看文件

@@ -155,6 +155,8 @@ uint16_t max_display_update_time = 0;
155 155
     extern bool powersupply_on;
156 156
   #endif
157 157
 
158
+  float move_menu_scale;
159
+
158 160
   ////////////////////////////////////////////
159 161
   ///////////////// Menu Tree ////////////////
160 162
   ////////////////////////////////////////////
@@ -2679,28 +2681,9 @@ void kill_screen(const char* lcd_msg) {
2679 2681
     END_MENU();
2680 2682
   }
2681 2683
 
2682
-  float move_menu_scale;
2683
-
2684
-  #if ENABLED(DELTA_CALIBRATION_MENU)
2684
+  #if ENABLED(DELTA_CALIBRATION_MENU) || (ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE)
2685 2685
 
2686 2686
     void lcd_move_z();
2687
-    void lcd_delta_calibrate_menu();
2688
-
2689
-    void _lcd_calibrate_homing() {
2690
-      if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
2691
-      lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
2692
-      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
2693
-        lcd_goto_previous_menu();
2694
-    }
2695
-
2696
-    void _lcd_delta_calibrate_home() {
2697
-      #if HAS_LEVELING
2698
-        reset_bed_level(); // After calibration bed-level data is no longer valid
2699
-      #endif
2700
-
2701
-      enqueue_and_echo_commands_P(PSTR("G28"));
2702
-      lcd_goto_screen(_lcd_calibrate_homing);
2703
-    }
2704 2687
 
2705 2688
     void _man_probe_pt(const float &rx, const float &ry) {
2706 2689
       #if HAS_LEVELING
@@ -2720,6 +2703,10 @@ void kill_screen(const char* lcd_msg) {
2720 2703
       lcd_goto_screen(lcd_move_z);
2721 2704
     }
2722 2705
 
2706
+  #endif // DELTA_CALIBRATION_MENU || (DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE)
2707
+
2708
+  #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
2709
+
2723 2710
     float lcd_probe_pt(const float &rx, const float &ry) {
2724 2711
       _man_probe_pt(rx, ry);
2725 2712
       KEEPALIVE_STATE(PAUSED_FOR_USER);
@@ -2731,6 +2718,26 @@ void kill_screen(const char* lcd_msg) {
2731 2718
       return current_position[Z_AXIS];
2732 2719
     }
2733 2720
 
2721
+  #endif // DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE
2722
+
2723
+  #if ENABLED(DELTA_CALIBRATION_MENU)
2724
+
2725
+    void _lcd_calibrate_homing() {
2726
+      if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
2727
+      lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
2728
+      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
2729
+        lcd_goto_previous_menu();
2730
+    }
2731
+
2732
+    void _lcd_delta_calibrate_home() {
2733
+      #if HAS_LEVELING
2734
+        reset_bed_level(); // After calibration bed-level data is no longer valid
2735
+      #endif
2736
+
2737
+      enqueue_and_echo_commands_P(PSTR("G28"));
2738
+      lcd_goto_screen(_lcd_calibrate_homing);
2739
+    }
2740
+
2734 2741
     void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); }
2735 2742
     void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); }
2736 2743
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }

+ 1
- 1
Marlin/src/lcd/ultralcd.h 查看文件

@@ -118,7 +118,7 @@
118 118
       float lcd_z_offset_edit();
119 119
     #endif
120 120
 
121
-    #if ENABLED(DELTA_CALIBRATION_MENU)
121
+    #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
122 122
       float lcd_probe_pt(const float &rx, const float &ry);
123 123
     #endif
124 124
 

正在加载...
取消
保存