Browse Source

added individual pullup setting option to have finer control in case there is a special z-min sensor, for example

Bernhard 13 years ago
parent
commit
0e5e249ab5
2 changed files with 53 additions and 37 deletions
  1. 20
    1
      Marlin/Configuration.h
  2. 33
    36
      Marlin/stepper.cpp

+ 20
- 1
Marlin/Configuration.h View File

127
 //=============================Mechanical Settings===========================
127
 //=============================Mechanical Settings===========================
128
 //===========================================================================
128
 //===========================================================================
129
 
129
 
130
-// Endstop Settings
130
+// corse Endstop Settings
131
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
131
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
132
 
132
 
133
+#ifndef ENDSTOPPULLUPS
134
+  // fine Enstop settings: Individual Pullups. will be ignord if ENDSTOPPULLUPS is defined
135
+  #define ENDSTOPPULLUP_XMAX
136
+  #define ENDSTOPPULLUP_YMAX
137
+  #define ENDSTOPPULLUP_ZMAX
138
+  #define ENDSTOPPULLUP_XMIN
139
+  #define ENDSTOPPULLUP_YMIN
140
+  //#define ENDSTOPPULLUP_ZMIN
141
+#endif
142
+
143
+#ifdef ENDSTOPPULLUPS
144
+  #define ENDSTOPPULLUP_XMAX
145
+  #define ENDSTOPPULLUP_YMAX
146
+  #define ENDSTOPPULLUP_ZMAX
147
+  #define ENDSTOPPULLUP_XMIN
148
+  #define ENDSTOPPULLUP_YMIN
149
+  #define ENDSTOPPULLUP_ZMIN
150
+#endif
151
+
133
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
152
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
134
 const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
153
 const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
135
 const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
154
 const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 

+ 33
- 36
Marlin/stepper.cpp View File

659
   #endif
659
   #endif
660
 
660
 
661
   //endstops and pullups
661
   //endstops and pullups
662
-  #ifdef ENDSTOPPULLUPS
663
-    #if X_MIN_PIN > -1
664
-      SET_INPUT(X_MIN_PIN); 
662
+  
663
+  #if X_MIN_PIN > -1
664
+    SET_INPUT(X_MIN_PIN); 
665
+    #ifdef ENDSTOPPULLUP_XMIN
665
       WRITE(X_MIN_PIN,HIGH);
666
       WRITE(X_MIN_PIN,HIGH);
666
     #endif
667
     #endif
667
-    #if X_MAX_PIN > -1
668
-      SET_INPUT(X_MAX_PIN); 
669
-      WRITE(X_MAX_PIN,HIGH);
670
-    #endif
671
-    #if Y_MIN_PIN > -1
672
-      SET_INPUT(Y_MIN_PIN); 
668
+  #endif
669
+      
670
+  #if Y_MIN_PIN > -1
671
+    SET_INPUT(Y_MIN_PIN); 
672
+    #ifdef ENDSTOPPULLUP_YMIN
673
       WRITE(Y_MIN_PIN,HIGH);
673
       WRITE(Y_MIN_PIN,HIGH);
674
     #endif
674
     #endif
675
-    #if Y_MAX_PIN > -1
676
-      SET_INPUT(Y_MAX_PIN); 
677
-      WRITE(Y_MAX_PIN,HIGH);
678
-    #endif
679
-    #if Z_MIN_PIN > -1
680
-      SET_INPUT(Z_MIN_PIN); 
675
+  #endif
676
+  
677
+  #if Z_MIN_PIN > -1
678
+    SET_INPUT(Z_MIN_PIN); 
679
+    #ifdef ENDSTOPPULLUP_ZMIN
681
       WRITE(Z_MIN_PIN,HIGH);
680
       WRITE(Z_MIN_PIN,HIGH);
682
     #endif
681
     #endif
683
-    #if Z_MAX_PIN > -1
684
-      SET_INPUT(Z_MAX_PIN); 
685
-      WRITE(Z_MAX_PIN,HIGH);
686
-    #endif
687
-  #else //ENDSTOPPULLUPS
688
-    #if X_MIN_PIN > -1
689
-      SET_INPUT(X_MIN_PIN); 
690
-    #endif
691
-    #if X_MAX_PIN > -1
692
-      SET_INPUT(X_MAX_PIN); 
693
-    #endif
694
-    #if Y_MIN_PIN > -1
695
-      SET_INPUT(Y_MIN_PIN); 
696
-    #endif
697
-    #if Y_MAX_PIN > -1
698
-      SET_INPUT(Y_MAX_PIN); 
682
+  #endif
683
+      
684
+  #if X_MAX_PIN > -1
685
+    SET_INPUT(X_MAX_PIN); 
686
+    #ifdef ENDSTOPPULLUP_XMAX
687
+      WRITE(X_MAX_PIN,HIGH);
699
     #endif
688
     #endif
700
-    #if Z_MIN_PIN > -1
701
-      SET_INPUT(Z_MIN_PIN); 
689
+  #endif
690
+      
691
+  #if Y_MAX_PIN > -1
692
+    SET_INPUT(Y_MAX_PIN); 
693
+    #ifdef ENDSTOPPULLUP_YMAX
694
+      WRITE(Y_MAX_PIN,HIGH);
702
     #endif
695
     #endif
703
-    #if Z_MAX_PIN > -1
704
-      SET_INPUT(Z_MAX_PIN); 
696
+  #endif
697
+  
698
+  #if Z_MAX_PIN > -1
699
+    SET_INPUT(Z_MAX_PIN); 
700
+    #ifdef ENDSTOPPULLUP_ZMAX
701
+      WRITE(Z_MAX_PIN,HIGH);
705
     #endif
702
     #endif
706
-  #endif //ENDSTOPPULLUPS
703
+  #endif
707
  
704
  
708
 
705
 
709
   //Initialize Step Pins
706
   //Initialize Step Pins

Loading…
Cancel
Save