summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde28
-rw-r--r--Tonokip_Firmware/configuration.h6
2 files changed, 20 insertions, 14 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index 9121093..df5dc93 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -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);}
@@ -444,6 +444,7 @@ inline void process_commands()
{
unsigned long codenum; //throw away variable
char *starpos = NULL;
+
if(code_seen('G'))
{
switch((int)code_value())
@@ -477,17 +478,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;
@@ -495,17 +496,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;
@@ -513,17 +514,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;
@@ -764,7 +765,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);
diff --git a/Tonokip_Firmware/configuration.h b/Tonokip_Firmware/configuration.h
index 8ef28e4..eab2e46 100644
--- a/Tonokip_Firmware/configuration.h
+++ b/Tonokip_Firmware/configuration.h
@@ -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