瀏覽代碼

Update Endstops class for 1.1.x parity

Scott Lahteine 7 年之前
父節點
當前提交
f10c87b442
共有 2 個文件被更改,包括 17 次插入23 次删除
  1. 7
    12
      Marlin/src/module/endstops.cpp
  2. 10
    11
      Marlin/src/module/endstops.h

+ 7
- 12
Marlin/src/module/endstops.cpp 查看文件

42
 bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
42
 bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
43
 volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
43
 volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
44
 
44
 
45
-#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
46
-  uint16_t
47
-#else
48
-  byte
49
-#endif
50
-    Endstops::current_endstop_bits = 0,
51
-    Endstops::old_endstop_bits = 0;
45
+Endstops::esbits_t Endstops::current_endstop_bits = 0,
46
+                   Endstops::old_endstop_bits = 0;
52
 
47
 
53
 #if HAS_BED_PROBE
48
 #if HAS_BED_PROBE
54
   volatile bool Endstops::z_probe_enabled = false;
49
   volatile bool Endstops::z_probe_enabled = false;
55
 #endif
50
 #endif
56
 
51
 
52
+// Initialized by settings.load()
57
 #if ENABLED(X_DUAL_ENDSTOPS)
53
 #if ENABLED(X_DUAL_ENDSTOPS)
58
-  float Endstops::x_endstop_adj; // Initialized by settings.load()
54
+  float Endstops::x_endstop_adj;
59
 #endif
55
 #endif
60
 #if ENABLED(Y_DUAL_ENDSTOPS)
56
 #if ENABLED(Y_DUAL_ENDSTOPS)
61
-  float Endstops::y_endstop_adj; // Initialized by settings.load()
57
+  float Endstops::y_endstop_adj;
62
 #endif
58
 #endif
63
 #if ENABLED(Z_DUAL_ENDSTOPS)
59
 #if ENABLED(Z_DUAL_ENDSTOPS)
64
-  float Endstops::z_endstop_adj; // Initialized by settings.load()
60
+  float Endstops::z_endstop_adj;
65
 #endif
61
 #endif
66
 
62
 
67
 /**
63
 /**
355
         _ENDSTOP_HIT(AXIS, MINMAX); \
351
         _ENDSTOP_HIT(AXIS, MINMAX); \
356
         stepper.endstop_triggered(_AXIS(AXIS)); \
352
         stepper.endstop_triggered(_AXIS(AXIS)); \
357
       } \
353
       } \
358
-    } while(0)
354
+    }while(0)
359
 
355
 
360
   #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ)
356
   #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ)
361
     // If G38 command is active check Z_MIN_PROBE for ALL movement
357
     // If G38 command is active check Z_MIN_PROBE for ALL movement
452
   /**
448
   /**
453
    * Check and update endstops according to conditions
449
    * Check and update endstops according to conditions
454
    */
450
    */
455
-
456
   if (X_MOVE_TEST) {
451
   if (X_MOVE_TEST) {
457
     if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction
452
     if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction
458
       #if HAS_X_MIN
453
       #if HAS_X_MIN

+ 10
- 11
Marlin/src/module/endstops.h 查看文件

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- *  endstops.h - manages endstops
24
+ * endstops.h - manages endstops
25
  */
25
  */
26
 
26
 
27
 #ifndef __ENDSTOPS_H__
27
 #ifndef __ENDSTOPS_H__
53
     static bool enabled, enabled_globally;
53
     static bool enabled, enabled_globally;
54
     static volatile char endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
54
     static volatile char endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
55
 
55
 
56
-    #if ENABLED(X_DUAL_ENDSTOPS)
57
-      static float x_endstop_adj;
58
-    #endif
59
-    #if ENABLED(Y_DUAL_ENDSTOPS)
60
-      static float y_endstop_adj;
61
-    #endif
62
-    #if ENABLED(Z_DUAL_ENDSTOPS)
63
-      static float z_endstop_adj;
64
-    #endif
65
     #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
56
     #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
66
       typedef uint16_t esbits_t;
57
       typedef uint16_t esbits_t;
58
+      #if ENABLED(X_DUAL_ENDSTOPS)
59
+        static float x_endstop_adj;
60
+      #endif
61
+      #if ENABLED(Y_DUAL_ENDSTOPS)
62
+        static float y_endstop_adj;
63
+      #endif
64
+      #if ENABLED(Z_DUAL_ENDSTOPS)
65
+        static float z_endstop_adj;
66
+      #endif
67
     #else
67
     #else
68
       typedef byte esbits_t;
68
       typedef byte esbits_t;
69
     #endif
69
     #endif
152
   #define ENDSTOPS_ENABLED  endstops.enabled
152
   #define ENDSTOPS_ENABLED  endstops.enabled
153
 #endif
153
 #endif
154
 
154
 
155
-
156
 #endif // __ENDSTOPS_H__
155
 #endif // __ENDSTOPS_H__

Loading…
取消
儲存