Merge pull request #25 from ScribbleJ/3dba0cd086d96358e6bc3570e364324406769304

Endstop patch
This commit is contained in:
kliment 2011-05-15 13:15:41 -07:00
commit a0272ab762
2 changed files with 20 additions and 14 deletions

View file

@ -224,7 +224,7 @@ void setup()
if(Y_ENABLE_PIN > -1) if(!Y_ENABLE_ON) digitalWrite(Y_ENABLE_PIN,HIGH);
if(Z_ENABLE_PIN > -1) if(!Z_ENABLE_ON) digitalWrite(Z_ENABLE_PIN,HIGH);
if(E_ENABLE_PIN > -1) if(!E_ENABLE_ON) digitalWrite(E_ENABLE_PIN,HIGH);
//endstop pullups
#ifdef ENDSTOPPULLUPS
if(X_MIN_PIN > -1) { pinMode(X_MIN_PIN,INPUT); digitalWrite(X_MIN_PIN,HIGH);}
@ -448,6 +448,7 @@ inline void process_commands()
{
unsigned long codenum; //throw away variable
char *starpos = NULL;
if(code_seen('G'))
{
switch((int)code_value())
@ -484,17 +485,17 @@ inline void process_commands()
current_e = 0;
feedrate = 0;
if(X_MIN_PIN > -1) {
if(X_MIN_PIN > -1 || X_MAX_PIN > -1) {
current_x = 0;
destination_x = -1.5 * X_MAX_LENGTH;
destination_x = 1.5 * X_MAX_LENGTH * X_HOME_DIR;
feedrate = min_units_per_second * 60;
prepare_move();
current_x = 0;
destination_x = 1;
destination_x = -1 * X_HOME_DIR;
prepare_move();
destination_x = -10;
destination_x = 10 * X_HOME_DIR;
prepare_move();
current_x = 0;
@ -502,17 +503,17 @@ inline void process_commands()
feedrate = 0;
}
if(Y_MIN_PIN > -1) {
if(Y_MIN_PIN > -1 || Y_MAX_PIN > -1) {
current_y = 0;
destination_y = -1.5 * Y_MAX_LENGTH;
destination_y = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
feedrate = min_units_per_second * 60;
prepare_move();
current_y = 0;
destination_y = 1;
destination_y = -1 * Y_HOME_DIR;
prepare_move();
destination_y = -10;
destination_y = 10 * Y_HOME_DIR;
prepare_move();
current_y = 0;
@ -520,17 +521,17 @@ inline void process_commands()
feedrate = 0;
}
if(Z_MIN_PIN > -1) {
if(Z_MIN_PIN > -1 || Z_MAX_PIN > -1) {
current_z = 0;
destination_z = -1.5 * Z_MAX_LENGTH;
destination_z = 1.5 * Z_MAX_LENGTH * Z_HOME_DIR;
feedrate = max_z_feedrate/2;
prepare_move();
current_z = 0;
destination_z = 1;
destination_z = -1 * Z_HOME_DIR;
prepare_move();
destination_z = -10;
destination_z = 10 * Z_HOME_DIR;
prepare_move();
current_z = 0;
@ -777,7 +778,6 @@ inline void process_commands()
case 115: // M115
Serial.println("FIRMWARE_NAME:Sprinter FIRMWARE_URL:http%%3A/github.com/kliment/Sprinter/ PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1");
break;
case 114: // M114
Serial.print("X:");
Serial.print(current_x);

View file

@ -115,6 +115,12 @@ const bool INVERT_Y_DIR = false;
const bool INVERT_Z_DIR = true;
const bool INVERT_E_DIR = false;
// Sets direction of endstops when homing; 1=MAX, -1=MIN
const int X_HOME_DIR = -1;
const int Y_HOME_DIR = -1;
const int Z_HOME_DIR = -1;
//Thermistor settings:
//Uncomment for 100k thermistor