瀏覽代碼

Fix compile error in gcode_G29

- A redo of #1576, which missed topo_flag
- Always set verbose_level
Scott Lahteine 9 年之前
父節點
當前提交
34e51f576f
共有 1 個文件被更改,包括 14 次插入18 次删除
  1. 14
    18
      Marlin/Marlin_main.cpp

+ 14
- 18
Marlin/Marlin_main.cpp 查看文件

@@ -1772,8 +1772,6 @@ inline void gcode_G28() {
1772 1772
 
1773 1773
   inline void gcode_G29() {
1774 1774
 
1775
-    float x_tmp, y_tmp, z_tmp, real_z;
1776
-
1777 1775
     // Prevent user from running a G29 without first homing in X and Y
1778 1776
     if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) {
1779 1777
       LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN);
@@ -1782,27 +1780,25 @@ inline void gcode_G28() {
1782 1780
       return;
1783 1781
     }
1784 1782
 
1783
+    int verbose_level = 1;
1784
+    float x_tmp, y_tmp, z_tmp, real_z;
1785
+
1786
+    if (code_seen('V') || code_seen('v')) {
1787
+      verbose_level = code_value_long();
1788
+      if (verbose_level < 0 || verbose_level > 4) {
1789
+        SERIAL_PROTOCOLPGM("?(V)erbose Level is implausible (0-4).\n");
1790
+        return;
1791
+      }
1792
+    }
1793
+
1785 1794
     bool enhanced_g29 = code_seen('E') || code_seen('e');
1786 1795
 
1787 1796
     #ifdef AUTO_BED_LEVELING_GRID
1788 1797
 
1789
-      // Example Syntax:  G29 N4 V2 E T
1790
-      int verbose_level = 1;
1798
+      bool topo_flag = verbose_level > 2 || code_seen('T') || code_seen('t');
1791 1799
 
1792
-      bool topo_flag = code_seen('T') || code_seen('t');
1793
-
1794
-      if (code_seen('V') || code_seen('v')) {
1795
-        verbose_level = code_value();
1796
-        if (verbose_level < 0 || verbose_level > 4) {
1797
-          SERIAL_PROTOCOLPGM("?(V)erbose Level is implausible (0-4).\n");
1798
-          return;
1799
-        }
1800
-        if (verbose_level > 0) {
1801
-          SERIAL_PROTOCOLPGM("G29 Enhanced Auto Bed Leveling Code V1.25:\n");
1802
-          SERIAL_PROTOCOLPGM("Full support at: http://3dprintboard.com/forum.php\n");
1803
-          if (verbose_level > 2) topo_flag = true;
1804
-        }
1805
-      }
1800
+      if (verbose_level > 0)
1801
+        SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n");
1806 1802
 
1807 1803
       int auto_bed_leveling_grid_points = code_seen('P') ? code_value_long() : AUTO_BED_LEVELING_GRID_POINTS;
1808 1804
       if (auto_bed_leveling_grid_points < 2 || auto_bed_leveling_grid_points > AUTO_BED_LEVELING_GRID_POINTS) {

Loading…
取消
儲存