瀏覽代碼

Fix M420 C for UBL

Scott Lahteine 7 年之前
父節點
當前提交
8db7fb226a

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl.h 查看文件

@@ -124,7 +124,7 @@ class unified_bed_leveling {
124 124
     static void reset();
125 125
     static void invalidate();
126 126
     static void set_all_mesh_points_to_value(const float value);
127
-    static void adjust_mesh_to_mean(const float value);
127
+    static void adjust_mesh_to_mean(const bool cflag, const float value);
128 128
     static bool sanity_check();
129 129
 
130 130
     static void G29() _O0;                          // O0 for no optimization

+ 4
- 4
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp 查看文件

@@ -544,7 +544,7 @@
544 544
           #endif
545 545
           break;
546 546
 
547
-        case 5: adjust_mesh_to_mean(g29_constant); break;
547
+        case 5: adjust_mesh_to_mean(g29_c_flag, g29_constant); break;
548 548
 
549 549
         case 6: shift_mesh_height(); break;
550 550
       }
@@ -634,7 +634,7 @@
634 634
     return;
635 635
   }
636 636
 
637
-  void unified_bed_leveling::adjust_mesh_to_mean(const float value) {
637
+  void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float value) {
638 638
     float sum = 0.0;
639 639
     int n = 0;
640 640
     for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
@@ -665,7 +665,7 @@
665 665
     SERIAL_ECHO_F(sigma, 6);
666 666
     SERIAL_EOL();
667 667
 
668
-    if (g29_c_flag)
668
+    if (cflag)
669 669
       for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
670 670
         for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
671 671
           if (!isnan(z_values[x][y]))
@@ -1081,7 +1081,7 @@
1081 1081
       SERIAL_EOL();
1082 1082
     #endif
1083 1083
 
1084
-    adjust_mesh_to_mean(g29_constant);
1084
+    adjust_mesh_to_mean(g29_c_flag, g29_constant);
1085 1085
 
1086 1086
     #if HAS_BED_PROBE
1087 1087
       SERIAL_PROTOCOLPGM("zprobe_zoffset: ");

+ 1
- 1
Marlin/src/gcode/bedlevel/M420.cpp 查看文件

@@ -116,7 +116,7 @@ void GcodeSuite::M420() {
116 116
       #if ENABLED(AUTO_BED_LEVELING_UBL)
117 117
 
118 118
         set_bed_leveling_enabled(false);
119
-        ubl.adjust_mesh_to_mean(cval);
119
+        ubl.adjust_mesh_to_mean(true, cval);
120 120
 
121 121
       #else
122 122
 

Loading…
取消
儲存