added individual pullup setting option to have finer control in case there is a special z-min sensor, for example
This commit is contained in:
		| @@ -127,9 +127,28 @@ | |||||||
| //=============================Mechanical Settings=========================== | //=============================Mechanical Settings=========================== | ||||||
| //=========================================================================== | //=========================================================================== | ||||||
|  |  | ||||||
| // Endstop Settings | // corse Endstop Settings | ||||||
| #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors | #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors | ||||||
|  |  | ||||||
|  | #ifndef ENDSTOPPULLUPS | ||||||
|  |   // fine Enstop settings: Individual Pullups. will be ignord if ENDSTOPPULLUPS is defined | ||||||
|  |   #define ENDSTOPPULLUP_XMAX | ||||||
|  |   #define ENDSTOPPULLUP_YMAX | ||||||
|  |   #define ENDSTOPPULLUP_ZMAX | ||||||
|  |   #define ENDSTOPPULLUP_XMIN | ||||||
|  |   #define ENDSTOPPULLUP_YMIN | ||||||
|  |   //#define ENDSTOPPULLUP_ZMIN | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifdef ENDSTOPPULLUPS | ||||||
|  |   #define ENDSTOPPULLUP_XMAX | ||||||
|  |   #define ENDSTOPPULLUP_YMAX | ||||||
|  |   #define ENDSTOPPULLUP_ZMAX | ||||||
|  |   #define ENDSTOPPULLUP_XMIN | ||||||
|  |   #define ENDSTOPPULLUP_YMIN | ||||||
|  |   #define ENDSTOPPULLUP_ZMIN | ||||||
|  | #endif | ||||||
|  |  | ||||||
| // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. | // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. | ||||||
| const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.  | const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.  | ||||||
| const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.  | const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.  | ||||||
|   | |||||||
| @@ -659,51 +659,48 @@ void st_init() | |||||||
|   #endif |   #endif | ||||||
|  |  | ||||||
|   //endstops and pullups |   //endstops and pullups | ||||||
|   #ifdef ENDSTOPPULLUPS |    | ||||||
|     #if X_MIN_PIN > -1 |   #if X_MIN_PIN > -1 | ||||||
|       SET_INPUT(X_MIN_PIN);  |     SET_INPUT(X_MIN_PIN);  | ||||||
|  |     #ifdef ENDSTOPPULLUP_XMIN | ||||||
|       WRITE(X_MIN_PIN,HIGH); |       WRITE(X_MIN_PIN,HIGH); | ||||||
|     #endif |     #endif | ||||||
|     #if X_MAX_PIN > -1 |   #endif | ||||||
|       SET_INPUT(X_MAX_PIN);  |        | ||||||
|       WRITE(X_MAX_PIN,HIGH); |   #if Y_MIN_PIN > -1 | ||||||
|     #endif |     SET_INPUT(Y_MIN_PIN);  | ||||||
|     #if Y_MIN_PIN > -1 |     #ifdef ENDSTOPPULLUP_YMIN | ||||||
|       SET_INPUT(Y_MIN_PIN);  |  | ||||||
|       WRITE(Y_MIN_PIN,HIGH); |       WRITE(Y_MIN_PIN,HIGH); | ||||||
|     #endif |     #endif | ||||||
|     #if Y_MAX_PIN > -1 |   #endif | ||||||
|       SET_INPUT(Y_MAX_PIN);  |    | ||||||
|       WRITE(Y_MAX_PIN,HIGH); |   #if Z_MIN_PIN > -1 | ||||||
|     #endif |     SET_INPUT(Z_MIN_PIN);  | ||||||
|     #if Z_MIN_PIN > -1 |     #ifdef ENDSTOPPULLUP_ZMIN | ||||||
|       SET_INPUT(Z_MIN_PIN);  |  | ||||||
|       WRITE(Z_MIN_PIN,HIGH); |       WRITE(Z_MIN_PIN,HIGH); | ||||||
|     #endif |     #endif | ||||||
|     #if Z_MAX_PIN > -1 |   #endif | ||||||
|       SET_INPUT(Z_MAX_PIN);  |        | ||||||
|  |   #if X_MAX_PIN > -1 | ||||||
|  |     SET_INPUT(X_MAX_PIN);  | ||||||
|  |     #ifdef ENDSTOPPULLUP_XMAX | ||||||
|  |       WRITE(X_MAX_PIN,HIGH); | ||||||
|  |     #endif | ||||||
|  |   #endif | ||||||
|  |        | ||||||
|  |   #if Y_MAX_PIN > -1 | ||||||
|  |     SET_INPUT(Y_MAX_PIN);  | ||||||
|  |     #ifdef ENDSTOPPULLUP_YMAX | ||||||
|  |       WRITE(Y_MAX_PIN,HIGH); | ||||||
|  |     #endif | ||||||
|  |   #endif | ||||||
|  |    | ||||||
|  |   #if Z_MAX_PIN > -1 | ||||||
|  |     SET_INPUT(Z_MAX_PIN);  | ||||||
|  |     #ifdef ENDSTOPPULLUP_ZMAX | ||||||
|       WRITE(Z_MAX_PIN,HIGH); |       WRITE(Z_MAX_PIN,HIGH); | ||||||
|     #endif |     #endif | ||||||
|   #else //ENDSTOPPULLUPS |   #endif | ||||||
|     #if X_MIN_PIN > -1 |  | ||||||
|       SET_INPUT(X_MIN_PIN);  |  | ||||||
|     #endif |  | ||||||
|     #if X_MAX_PIN > -1 |  | ||||||
|       SET_INPUT(X_MAX_PIN);  |  | ||||||
|     #endif |  | ||||||
|     #if Y_MIN_PIN > -1 |  | ||||||
|       SET_INPUT(Y_MIN_PIN);  |  | ||||||
|     #endif |  | ||||||
|     #if Y_MAX_PIN > -1 |  | ||||||
|       SET_INPUT(Y_MAX_PIN);  |  | ||||||
|     #endif |  | ||||||
|     #if Z_MIN_PIN > -1 |  | ||||||
|       SET_INPUT(Z_MIN_PIN);  |  | ||||||
|     #endif |  | ||||||
|     #if Z_MAX_PIN > -1 |  | ||||||
|       SET_INPUT(Z_MAX_PIN);  |  | ||||||
|     #endif |  | ||||||
|   #endif //ENDSTOPPULLUPS |  | ||||||
|   |   | ||||||
|  |  | ||||||
|   //Initialize Step Pins |   //Initialize Step Pins | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user