瀏覽代碼

Merge pull request #7591 from thinkyhead/bf1_misc_patches

M111: no args reports current flags
Scott Lahteine 7 年之前
父節點
當前提交
367e1b54ba
共有 2 個文件被更改,包括 23 次插入15 次删除
  1. 11
    4
      Marlin/Conditionals_post.h
  2. 12
    11
      Marlin/Marlin_main.cpp

+ 11
- 4
Marlin/Conditionals_post.h 查看文件

@@ -28,6 +28,10 @@
28 28
 #ifndef CONDITIONALS_POST_H
29 29
 #define CONDITIONALS_POST_H
30 30
 
31
+  #define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
32
+  #define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
33
+  #define IS_CARTESIAN !IS_KINEMATIC
34
+
31 35
   /**
32 36
    * Axis lengths and center
33 37
    */
@@ -43,6 +47,12 @@
43 47
     #define Y_BED_SIZE Y_MAX_LENGTH
44 48
   #endif
45 49
 
50
+  // Require 0,0 bed center for Delta and SCARA
51
+  #if IS_KINEMATIC
52
+    #define BED_CENTER_AT_0_0
53
+  #endif
54
+
55
+  // Define center values for future use
46 56
   #if ENABLED(BED_CENTER_AT_0_0)
47 57
     #define X_CENTER 0
48 58
     #define Y_CENTER 0
@@ -52,6 +62,7 @@
52 62
   #endif
53 63
   #define Z_CENTER ((Z_MIN_POS + Z_MAX_POS) / 2)
54 64
 
65
+  // Get the linear boundaries of the bed
55 66
   #define X_MIN_BED (X_CENTER - (X_BED_SIZE) / 2)
56 67
   #define X_MAX_BED (X_CENTER + (X_BED_SIZE) / 2)
57 68
   #define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2)
@@ -85,10 +96,6 @@
85 96
     #endif
86 97
   #endif
87 98
 
88
-  #define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
89
-  #define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
90
-  #define IS_CARTESIAN !IS_KINEMATIC
91
-
92 99
   /**
93 100
    * No adjustable bed on non-cartesians
94 101
    */

+ 12
- 11
Marlin/Marlin_main.cpp 查看文件

@@ -5567,7 +5567,7 @@ void home_all_axes() { gcode_G28(true); }
5567 5567
             N++;
5568 5568
           }
5569 5569
         zero_std_dev_old = zero_std_dev;
5570
-        zero_std_dev = round(sqrt(S2 / N) * 1000.0) / 1000.0 + 0.00001;
5570
+        zero_std_dev = round(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001;
5571 5571
 
5572 5572
         // Solve matrices
5573 5573
 
@@ -7753,16 +7753,17 @@ inline void gcode_M110() {
7753 7753
  * M111: Set the debug level
7754 7754
  */
7755 7755
 inline void gcode_M111() {
7756
-  marlin_debug_flags = parser.byteval('S', (uint8_t)DEBUG_NONE);
7757
-
7758
-  const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO;
7759
-  const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO;
7760
-  const static char str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS;
7761
-  const static char str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN;
7762
-  const static char str_debug_16[] PROGMEM = MSG_DEBUG_COMMUNICATION;
7763
-  #if ENABLED(DEBUG_LEVELING_FEATURE)
7764
-    const static char str_debug_32[] PROGMEM = MSG_DEBUG_LEVELING;
7765
-  #endif
7756
+  if (parser.seen('S')) marlin_debug_flags = parser.byteval('S');
7757
+
7758
+  const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO,
7759
+                    str_debug_2[] PROGMEM = MSG_DEBUG_INFO,
7760
+                    str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS,
7761
+                    str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN,
7762
+                    str_debug_16[] PROGMEM = MSG_DEBUG_COMMUNICATION
7763
+                    #if ENABLED(DEBUG_LEVELING_FEATURE)
7764
+                      , str_debug_32[] PROGMEM = MSG_DEBUG_LEVELING
7765
+                    #endif
7766
+                    ;
7766 7767
 
7767 7768
   const static char* const debug_strings[] PROGMEM = {
7768 7769
     str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16

Loading…
取消
儲存