ソースを参照

Merge pull request #6537 from thinkyhead/rc_cleanup_sunday

Various leveling-related patches
Scott Lahteine 8年前
コミット
99b11db1a1

+ 3
- 4
Marlin/Conditionals_post.h ファイルの表示

@@ -718,15 +718,14 @@
718 718
   #endif
719 719
 
720 720
   /**
721
-   * Set ABL options based on the specific type of leveling
721
+   * Set granular options based on the specific type of leveling
722 722
    */
723 723
   #define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
724 724
   #define ABL_GRID   (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
725 725
   #define HAS_ABL    (ABL_PLANAR || ABL_GRID || ENABLED(AUTO_BED_LEVELING_UBL))
726
-
727
-  #define PLANNER_LEVELING      (HAS_ABL || ENABLED(MESH_BED_LEVELING))
726
+  #define HAS_LEVELING          (HAS_ABL || ENABLED(MESH_BED_LEVELING))
727
+  #define PLANNER_LEVELING      (ABL_PLANAR || ABL_GRID || ENABLED(MESH_BED_LEVELING))
728 728
   #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
729
-
730 729
   #if HAS_PROBING_PROCEDURE
731 730
     #define PROBE_BED_WIDTH abs(RIGHT_PROBE_BED_POSITION - (LEFT_PROBE_BED_POSITION))
732 731
     #define PROBE_BED_HEIGHT abs(BACK_PROBE_BED_POSITION - (FRONT_PROBE_BED_POSITION))

+ 20
- 19
Marlin/G26_Mesh_Validation_Tool.cpp ファイルの表示

@@ -115,25 +115,29 @@
115 115
    *   Y #  Y coordinate  Specify the starting location of the drawing activity.
116 116
    */
117 117
 
118
+  // External references
119
+
118 120
   extern float feedrate;
119 121
   extern Planner planner;
120
-  //#if ENABLED(ULTRA_LCD)
122
+  #if ENABLED(ULTRA_LCD)
121 123
     extern char lcd_status_message[];
122
-  //#endif
124
+  #endif
123 125
   extern float destination[XYZE];
124
-  extern void set_destination_to_current();
125
-  extern void set_current_to_destination();
126
-  extern float code_value_float();
127
-  extern bool code_value_bool();
128
-  extern bool code_has_value();
129
-  extern void lcd_init();
130
-  extern void lcd_setstatuspgm(const char* const message, const uint8_t level);
131
-  #define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) //bob
126
+  void set_destination_to_current();
127
+  void set_current_to_destination();
128
+  float code_value_float();
129
+  bool code_value_bool();
130
+  bool code_has_value();
131
+  void lcd_init();
132
+  void lcd_setstatuspgm(const char* const message, const uint8_t level);
132 133
   bool prepare_move_to_destination_cartesian();
133 134
   void line_to_destination();
134
-  void line_to_destination(float );
135
-  void gcode_G28();
135
+  void line_to_destination(float);
136 136
   void sync_plan_position_e();
137
+  void chirp_at_user();
138
+
139
+  // Private functions
140
+
137 141
   void un_retract_filament(float where[XYZE]);
138 142
   void retract_filament(float where[XYZE]);
139 143
   void look_for_lines_to_connect();
@@ -142,17 +146,14 @@
142 146
   void print_line_from_here_to_there(const float&, const float&, const float&, const float&, const float&, const float&);
143 147
   bool turn_on_heaters();
144 148
   bool prime_nozzle();
145
-  void chirp_at_user();
146 149
 
147 150
   static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16], continue_with_closest = 0;
148 151
   float g26_e_axis_feedrate = 0.020,
149 152
         random_deviation = 0.0,
150 153
         layer_height = LAYER_HEIGHT;
151 154
 
152
-  bool g26_retracted = false; // We keep track of the state of the nozzle to know if it
153
-                              // is currently retracted or not.  This allows us to be
154
-                              // less careful because mis-matched retractions and un-retractions
155
-                              // won't leave us in a bad state.
155
+  static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched
156
+                                     // retracts/recovers won't result in a bad state.
156 157
 
157 158
   float valid_trig_angle(float);
158 159
   mesh_index_pair find_closest_circle_to_print(const float&, const float&);
@@ -167,9 +168,9 @@
167 168
                hotend_temp = HOTEND_TEMP,
168 169
                ooze_amount = OOZE_AMOUNT;
169 170
 
170
-  int8_t prime_flag = 0;
171
+  static int8_t prime_flag = 0;
171 172
 
172
-  bool keep_heaters_on = false;
173
+  static bool keep_heaters_on = false;
173 174
 
174 175
   /**
175 176
    * G26: Mesh Validation Pattern generation.

+ 1
- 1
Marlin/Marlin.h ファイルの表示

@@ -324,7 +324,7 @@ float code_value_temp_diff();
324 324
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);
325 325
 #endif
326 326
 
327
-#if PLANNER_LEVELING
327
+#if HAS_LEVELING
328 328
   void reset_bed_level();
329 329
 #endif
330 330
 

+ 51
- 61
Marlin/Marlin_main.cpp ファイルの表示

@@ -490,8 +490,6 @@ static uint8_t target_extruder;
490 490
   float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
491 491
 #endif
492 492
 
493
-#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]))
494
-
495 493
 #if HAS_ABL
496 494
   float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
497 495
   #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s
@@ -2405,7 +2403,7 @@ static void clean_up_after_endstop_or_probe_move() {
2405 2403
 
2406 2404
 #endif // HAS_BED_PROBE
2407 2405
 
2408
-#if PLANNER_LEVELING
2406
+#if HAS_LEVELING
2409 2407
   /**
2410 2408
    * Turn bed leveling on or off, fixing the current
2411 2409
    * position as-needed.
@@ -2426,7 +2424,12 @@ static void clean_up_after_endstop_or_probe_move() {
2426 2424
         if (enable && mbl.has_mesh()) planner.unapply_leveling(current_position);
2427 2425
       }
2428 2426
 
2429
-    #elif HAS_ABL && !ENABLED(AUTO_BED_LEVELING_UBL)
2427
+    #elif ENABLED(AUTO_BED_LEVELING_UBL)
2428
+
2429
+      ubl.state.active = enable;
2430
+      //set_current_from_steppers_for_axis(Z_AXIS);
2431
+
2432
+    #else
2430 2433
 
2431 2434
       #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
2432 2435
         const bool can_change = (!enable || (bilinear_grid_spacing[0] && bilinear_grid_spacing[1]));
@@ -2454,9 +2457,6 @@ static void clean_up_after_endstop_or_probe_move() {
2454 2457
         else
2455 2458
           planner.unapply_leveling(current_position);
2456 2459
       }
2457
-    #elif ENABLED(AUTO_BED_LEVELING_UBL)
2458
-      ubl.state.active = enable;
2459
-      //set_current_from_steppers_for_axis(Z_AXIS);
2460 2460
     #endif
2461 2461
   }
2462 2462
 
@@ -2513,7 +2513,7 @@ static void clean_up_after_endstop_or_probe_move() {
2513 2513
     #endif
2514 2514
   }
2515 2515
 
2516
-#endif // PLANNER_LEVELING
2516
+#endif // HAS_LEVELING
2517 2517
 
2518 2518
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
2519 2519
 
@@ -3749,10 +3749,7 @@ inline void gcode_G28() {
3749 3749
   #endif
3750 3750
 
3751 3751
   // Disable the leveling matrix before homing
3752
-  #if PLANNER_LEVELING
3753
-    #if ENABLED(AUTO_BED_LEVELING_UBL)
3754
-      const bool bed_leveling_state_at_entry = ubl.state.active;
3755
-    #endif
3752
+  #if HAS_LEVELING
3756 3753
     set_bed_leveling_enabled(false);
3757 3754
   #endif
3758 3755
 
@@ -3895,25 +3892,6 @@ inline void gcode_G28() {
3895 3892
     do_blocking_move_to_z(delta_clip_start_height);
3896 3893
   #endif
3897 3894
 
3898
-  #if ENABLED(AUTO_BED_LEVELING_UBL)
3899
-    set_bed_leveling_enabled(bed_leveling_state_at_entry);
3900
-  #endif
3901
-
3902
-  // Enable mesh leveling again
3903
-  #if ENABLED(MESH_BED_LEVELING)
3904
-    if (mbl.reactivate()) {
3905
-      set_bed_leveling_enabled(true);
3906
-      if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) {
3907
-        #if ENABLED(MESH_G28_REST_ORIGIN)
3908
-          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
3909
-          set_destination_to_current();
3910
-          line_to_destination(homing_feedrate_mm_s[Z_AXIS]);
3911
-          stepper.synchronize();
3912
-        #endif
3913
-      }
3914
-    }
3915
-  #endif
3916
-
3917 3895
   clean_up_after_endstop_or_probe_move();
3918 3896
 
3919 3897
   // Restore the active tool after homing
@@ -3928,6 +3906,8 @@ inline void gcode_G28() {
3928 3906
   #endif
3929 3907
 }
3930 3908
 
3909
+void home_all_axes() { gcode_G28(); }
3910
+
3931 3911
 #if HAS_PROBING_PROCEDURE
3932 3912
 
3933 3913
   void out_of_range_error(const char* p_edge) {
@@ -3980,6 +3960,18 @@ inline void gcode_G28() {
3980 3960
     );
3981 3961
   }
3982 3962
 
3963
+  void mesh_probing_done() {
3964
+    mbl.set_has_mesh(true);
3965
+    home_all_axes();
3966
+    set_bed_leveling_enabled(true);
3967
+    #if ENABLED(MESH_G28_REST_ORIGIN)
3968
+      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
3969
+      set_destination_to_current();
3970
+      line_to_destination(homing_feedrate_mm_s[Z_AXIS]);
3971
+      stepper.synchronize();
3972
+    #endif
3973
+  }
3974
+
3983 3975
   /**
3984 3976
    * G29: Mesh-based Z probe, probes a grid and produces a
3985 3977
    *      mesh to compensate for variable bed height
@@ -4070,14 +4062,12 @@ inline void gcode_G28() {
4070 4062
           line_to_current_position();
4071 4063
           stepper.synchronize();
4072 4064
 
4073
-          // After recording the last point, activate the mbl and home
4074
-          SERIAL_PROTOCOLLNPGM("Mesh probing done.");
4065
+          // After recording the last point, activate home and activate
4075 4066
           mbl_probe_index = -1;
4076
-          mbl.set_has_mesh(true);
4077
-          mbl.set_reactivate(true);
4078
-          enqueue_and_echo_commands_P(PSTR("G28"));
4067
+          SERIAL_PROTOCOLLNPGM("Mesh probing done.");
4079 4068
           BUZZ(100, 659);
4080 4069
           BUZZ(100, 698);
4070
+          mesh_probing_done();
4081 4071
         }
4082 4072
         break;
4083 4073
 
@@ -4368,7 +4358,7 @@ inline void gcode_G28() {
4368 4358
 
4369 4359
       #endif
4370 4360
 
4371
-      #if PLANNER_LEVELING
4361
+      #if HAS_LEVELING
4372 4362
 
4373 4363
         // Jettison bed leveling data
4374 4364
         if (code_seen('J')) {
@@ -5013,7 +5003,7 @@ inline void gcode_G28() {
5013 5003
       SYNC_PLAN_POSITION_KINEMATIC();
5014 5004
   }
5015 5005
 
5016
-#endif // HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL)
5006
+#endif // HAS_ABL && !AUTO_BED_LEVELING_UBL
5017 5007
 
5018 5008
 #if HAS_BED_PROBE
5019 5009
 
@@ -5034,7 +5024,7 @@ inline void gcode_G28() {
5034 5024
     if (!position_is_reachable(pos, true)) return;
5035 5025
 
5036 5026
     // Disable leveling so the planner won't mess with us
5037
-    #if PLANNER_LEVELING
5027
+    #if HAS_LEVELING
5038 5028
       set_bed_leveling_enabled(false);
5039 5029
     #endif
5040 5030
 
@@ -5091,7 +5081,7 @@ inline void gcode_G28() {
5091 5081
 
5092 5082
       stepper.synchronize();
5093 5083
 
5094
-      #if PLANNER_LEVELING
5084
+      #if HAS_LEVELING
5095 5085
         set_bed_leveling_enabled(false);
5096 5086
       #endif
5097 5087
 
@@ -6198,10 +6188,6 @@ inline void gcode_M42() {
6198 6188
    * regenerated.
6199 6189
    */
6200 6190
   inline void gcode_M48() {
6201
-  #if ENABLED(AUTO_BED_LEVELING_UBL)
6202
-  bool bed_leveling_state_at_entry=0;
6203
-    bed_leveling_state_at_entry = ubl.state.active;
6204
-  #endif
6205 6191
 
6206 6192
     if (axis_unhomed_error(true, true, true)) return;
6207 6193
 
@@ -6220,8 +6206,8 @@ inline void gcode_M42() {
6220 6206
       return;
6221 6207
     }
6222 6208
 
6223
-    float  X_current = current_position[X_AXIS],
6224
-           Y_current = current_position[Y_AXIS];
6209
+    float X_current = current_position[X_AXIS],
6210
+          Y_current = current_position[Y_AXIS];
6225 6211
 
6226 6212
     bool stow_probe_after_each = code_seen('E');
6227 6213
 
@@ -6267,8 +6253,17 @@ inline void gcode_M42() {
6267 6253
       SERIAL_PROTOCOLLNPGM("Positioning the probe...");
6268 6254
 
6269 6255
     // Disable bed level correction in M48 because we want the raw data when we probe
6270
-    #if HAS_ABL
6271
-      const bool abl_was_enabled = planner.abl_enabled;
6256
+
6257
+    #if HAS_LEVELING
6258
+      const bool was_enabled =
6259
+        #if ENABLED(AUTO_BED_LEVELING_UBL)
6260
+          ubl.state.active
6261
+        #elif ENABLED(MESH_BED_LEVELING)
6262
+          mbl.active()
6263
+        #else
6264
+          planner.abl_enabled
6265
+        #endif
6266
+      ;
6272 6267
       set_bed_leveling_enabled(false);
6273 6268
     #endif
6274 6269
 
@@ -6420,14 +6415,9 @@ inline void gcode_M42() {
6420 6415
 
6421 6416
     clean_up_after_endstop_or_probe_move();
6422 6417
 
6423
-    // Re-enable bed level correction if it has been on
6418
+    // Re-enable bed level correction if it had been on
6424 6419
     #if HAS_ABL
6425
-      set_bed_leveling_enabled(abl_was_enabled);
6426
-    #endif
6427
-
6428
-    #if ENABLED(AUTO_BED_LEVELING_UBL)
6429
-      set_bed_leveling_enabled(bed_leveling_state_at_entry);
6430
-      ubl.state.active = bed_leveling_state_at_entry;
6420
+      set_bed_leveling_enabled(was_enabled);
6431 6421
     #endif
6432 6422
 
6433 6423
     report_current_position();
@@ -7294,7 +7284,7 @@ inline void gcode_M115() {
7294 7284
     #endif
7295 7285
 
7296 7286
     // MESH_REPORT (M420 V)
7297
-    #if PLANNER_LEVELING
7287
+    #if HAS_LEVELING
7298 7288
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:1");
7299 7289
     #else
7300 7290
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0");
@@ -8336,7 +8326,7 @@ void quickstop_stepper() {
8336 8326
   SYNC_PLAN_POSITION_KINEMATIC();
8337 8327
 }
8338 8328
 
8339
-#if PLANNER_LEVELING
8329
+#if HAS_LEVELING
8340 8330
   /**
8341 8331
    * M420: Enable/Disable Bed Leveling and/or set the Z fade height.
8342 8332
    *
@@ -9857,12 +9847,12 @@ void process_next_command() {
9857 9847
         gcode_G28();
9858 9848
         break;
9859 9849
 
9860
-      #if PLANNER_LEVELING || ENABLED(AUTO_BED_LEVELING_UBL)
9850
+      #if HAS_LEVELING
9861 9851
         case 29: // G29 Detailed Z probe, probes the bed at 3 or more points,
9862 9852
                  // or provides access to the UBL System if enabled.
9863 9853
           gcode_G29();
9864 9854
           break;
9865
-      #endif // PLANNER_LEVELING
9855
+      #endif // HAS_LEVELING
9866 9856
 
9867 9857
       #if HAS_BED_PROBE
9868 9858
 
@@ -10363,7 +10353,7 @@ void process_next_command() {
10363 10353
           break;
10364 10354
       #endif // FILAMENT_WIDTH_SENSOR
10365 10355
 
10366
-      #if PLANNER_LEVELING
10356
+      #if HAS_LEVELING
10367 10357
         case 420: // M420: Enable/Disable Bed Leveling
10368 10358
           gcode_M420();
10369 10359
           break;
@@ -10917,7 +10907,7 @@ void get_cartesian_from_steppers() {
10917 10907
  */
10918 10908
 void set_current_from_steppers_for_axis(const AxisEnum axis) {
10919 10909
   get_cartesian_from_steppers();
10920
-  #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
10910
+  #if PLANNER_LEVELING
10921 10911
     planner.unapply_leveling(cartes);
10922 10912
   #endif
10923 10913
   if (axis == ALL_AXES)

+ 1
- 1
Marlin/configuration_store.cpp ファイルの表示

@@ -1071,7 +1071,7 @@ void MarlinSettings::reset() {
1071 1071
   #endif
1072 1072
 
1073 1073
   // Applies to all MBL and ABL
1074
-  #if PLANNER_LEVELING
1074
+  #if HAS_LEVELING
1075 1075
     reset_bed_level();
1076 1076
   #endif
1077 1077
 

+ 1
- 4
Marlin/mesh_bed_leveling.h ファイルの表示

@@ -36,8 +36,7 @@
36 36
   enum MBLStatus {
37 37
     MBL_STATUS_NONE = 0,
38 38
     MBL_STATUS_HAS_MESH_BIT = 0,
39
-    MBL_STATUS_ACTIVE_BIT = 1,
40
-    MBL_STATUS_REACTIVATE_BIT = 2
39
+    MBL_STATUS_ACTIVE_BIT = 1
41 40
   };
42 41
 
43 42
   #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_POINTS_X - 1))
@@ -61,8 +60,6 @@
61 60
     static void set_active(const bool onOff)   { onOff ? SBI(status, MBL_STATUS_ACTIVE_BIT) : CBI(status, MBL_STATUS_ACTIVE_BIT); }
62 61
     static bool has_mesh()                     { return TEST(status, MBL_STATUS_HAS_MESH_BIT); }
63 62
     static void set_has_mesh(const bool onOff) { onOff ? SBI(status, MBL_STATUS_HAS_MESH_BIT) : CBI(status, MBL_STATUS_HAS_MESH_BIT); }
64
-    static bool reactivate()                   { bool b = TEST(status, MBL_STATUS_REACTIVATE_BIT); CBI(status, MBL_STATUS_REACTIVATE_BIT); return b; }
65
-    static void set_reactivate(const bool onOff) { onOff ? SBI(status, MBL_STATUS_REACTIVATE_BIT) : CBI(status, MBL_STATUS_REACTIVATE_BIT); }
66 63
 
67 64
     static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) {
68 65
       px = index % (GRID_MAX_POINTS_X);

+ 3
- 3
Marlin/planner.cpp ファイルの表示

@@ -530,7 +530,7 @@ void Planner::check_axes_activity() {
530 530
   #endif
531 531
 }
532 532
 
533
-#if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
533
+#if PLANNER_LEVELING
534 534
   /**
535 535
    * lx, ly, lz - logical (cartesian, not delta) positions in mm
536 536
    */
@@ -634,7 +634,7 @@ void Planner::check_axes_activity() {
634 634
     #endif
635 635
   }
636 636
 
637
-#endif // PLANNER_LEVELING && !AUTO_BED_LEVELING_UBL
637
+#endif // PLANNER_LEVELING
638 638
 
639 639
 /**
640 640
  * Planner::_buffer_line
@@ -1434,7 +1434,7 @@ void Planner::_set_position_mm(const float &a, const float &b, const float &c, c
1434 1434
 }
1435 1435
 
1436 1436
 void Planner::set_position_mm_kinematic(const float position[NUM_AXIS]) {
1437
-  #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
1437
+  #if PLANNER_LEVELING
1438 1438
     float lpos[XYZ] = { position[X_AXIS], position[Y_AXIS], position[Z_AXIS] };
1439 1439
     apply_leveling(lpos);
1440 1440
   #else

+ 6
- 4
Marlin/planner.h ファイルの表示

@@ -246,7 +246,7 @@ class Planner {
246 246
 
247 247
     static bool is_full() { return (block_buffer_tail == BLOCK_MOD(block_buffer_head + 1)); }
248 248
 
249
-    #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
249
+    #if PLANNER_LEVELING
250 250
 
251 251
       #define ARG_X float lx
252 252
       #define ARG_Y float ly
@@ -296,7 +296,7 @@ class Planner {
296 296
      *  extruder     - target extruder
297 297
      */
298 298
     static FORCE_INLINE void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder) {
299
-      #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL) && IS_CARTESIAN
299
+      #if PLANNER_LEVELING && IS_CARTESIAN
300 300
         apply_leveling(lx, ly, lz);
301 301
       #endif
302 302
       _buffer_line(lx, ly, lz, e, fr_mm_s, extruder);
@@ -312,7 +312,7 @@ class Planner {
312 312
      *  extruder - target extruder
313 313
      */
314 314
     static FORCE_INLINE void buffer_line_kinematic(const float ltarget[XYZE], const float &fr_mm_s, const uint8_t extruder) {
315
-      #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
315
+      #if PLANNER_LEVELING
316 316
         float lpos[XYZ] = { ltarget[X_AXIS], ltarget[Y_AXIS], ltarget[Z_AXIS] };
317 317
         apply_leveling(lpos);
318 318
       #else
@@ -336,7 +336,7 @@ class Planner {
336 336
      * Clears previous speed values.
337 337
      */
338 338
     static FORCE_INLINE void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
339
-      #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL) && IS_CARTESIAN
339
+      #if PLANNER_LEVELING && IS_CARTESIAN
340 340
         apply_leveling(lx, ly, lz);
341 341
       #endif
342 342
       _set_position_mm(lx, ly, lz, e);
@@ -469,6 +469,8 @@ class Planner {
469 469
 
470 470
 };
471 471
 
472
+#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]))
473
+
472 474
 extern Planner planner;
473 475
 
474 476
 #endif // PLANNER_H

+ 2
- 1
Marlin/ubl.h ファイルの表示

@@ -61,8 +61,9 @@
61 61
   bool is_bit_set(uint16_t bits[16], uint8_t x, uint8_t y);
62 62
   char *ftostr43sign(const float&, char);
63 63
 
64
+  void home_all_axes();
65
+
64 66
   void gcode_G26();
65
-  void gcode_G28();
66 67
   void gcode_G29();
67 68
 
68 69
   extern int ubl_cnt;

+ 1
- 1
Marlin/ubl_G29.cpp ファイルの表示

@@ -324,7 +324,7 @@
324 324
     }
325 325
 
326 326
     if (!code_seen('N') && axis_unhomed_error(true, true, true))  // Don't allow auto-leveling without homing first
327
-      gcode_G28();
327
+      home_all_axes();
328 328
 
329 329
     if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
330 330
 

+ 3
- 2
Marlin/ultralcd.cpp ファイルの表示

@@ -162,6 +162,7 @@ uint16_t max_display_update_time = 0;
162 162
 
163 163
   #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
164 164
     #include "mesh_bed_leveling.h"
165
+    extern void mesh_probing_done();
165 166
   #endif
166 167
 
167 168
   ////////////////////////////////////////////
@@ -1539,9 +1540,9 @@ void kill_screen(const char* lcd_msg) {
1539 1540
           // Enable leveling, if needed
1540 1541
           #if ENABLED(MESH_BED_LEVELING)
1541 1542
 
1543
+            lcd_synchronize();
1542 1544
             mbl.set_has_mesh(true);
1543
-            mbl.set_reactivate(true);
1544
-            enqueue_and_echo_commands_P(PSTR("G28"));
1545
+            mesh_probing_done();
1545 1546
 
1546 1547
           #elif ENABLED(AUTO_BED_LEVELING_UBL)
1547 1548
 

読み込み中…
キャンセル
保存