Add definition for the teensy 2.0 and disable X,Y, and E axis
This commit is contained in:
parent
6d5a3297f4
commit
a982551e27
5 changed files with 466 additions and 47 deletions
|
|
@ -13,7 +13,8 @@
|
||||||
// Gen 3 Plus = 21
|
// Gen 3 Plus = 21
|
||||||
// gen 3 Monolithic Electronics = 22
|
// gen 3 Monolithic Electronics = 22
|
||||||
// Gen3 PLUS for TechZone Gen3 Remix Motherboard = 23
|
// Gen3 PLUS for TechZone Gen3 Remix Motherboard = 23
|
||||||
#define MOTHERBOARD 3
|
// Teensy 2.0 driving lemon curry = 10
|
||||||
|
#define MOTHERBOARD 10
|
||||||
|
|
||||||
//// Thermistor settings:
|
//// Thermistor settings:
|
||||||
// 1 is 100k thermistor
|
// 1 is 100k thermistor
|
||||||
|
|
@ -24,7 +25,7 @@
|
||||||
// 6 is EPCOS 100k
|
// 6 is EPCOS 100k
|
||||||
// 7 is 100k Honeywell thermistor 135-104LAG-J01
|
// 7 is 100k Honeywell thermistor 135-104LAG-J01
|
||||||
#define THERMISTORHEATER 1
|
#define THERMISTORHEATER 1
|
||||||
#define THERMISTORBED 1
|
//#define THERMISTORBED 1
|
||||||
|
|
||||||
//// Calibration variables
|
//// Calibration variables
|
||||||
// X, Y, Z, E steps per unit - Metric Prusa Mendel with Wade extruder:
|
// X, Y, Z, E steps per unit - Metric Prusa Mendel with Wade extruder:
|
||||||
|
|
@ -48,7 +49,7 @@ const bool Z_ENDSTOP_INVERT = false;
|
||||||
#define BAUDRATE 115200
|
#define BAUDRATE 115200
|
||||||
|
|
||||||
// Comment out (using // at the start of the line) to disable SD support:
|
// Comment out (using // at the start of the line) to disable SD support:
|
||||||
#define SDSUPPORT
|
//#define SDSUPPORT
|
||||||
// Uncomment to make Sprinter run init.g from SD on boot
|
// Uncomment to make Sprinter run init.g from SD on boot
|
||||||
//#define SDINITFILE
|
//#define SDINITFILE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ int analog2temp_ad595(int raw);
|
||||||
int temp2analog_max6675(int celsius);
|
int temp2analog_max6675(int celsius);
|
||||||
int analog2temp_max6675(int raw);
|
int analog2temp_max6675(int raw);
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
#if X_ENABLE_PIN > -1
|
#if X_ENABLE_PIN > -1
|
||||||
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
|
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
|
||||||
#define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
|
#define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
|
||||||
|
|
@ -63,6 +63,7 @@ int analog2temp_max6675(int raw);
|
||||||
#define enable_y() ;
|
#define enable_y() ;
|
||||||
#define disable_y() ;
|
#define disable_y() ;
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if Z_ENABLE_PIN > -1
|
#if Z_ENABLE_PIN > -1
|
||||||
#define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
|
#define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
|
||||||
#define disable_z() WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON)
|
#define disable_z() WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON)
|
||||||
|
|
@ -70,14 +71,14 @@ int analog2temp_max6675(int raw);
|
||||||
#define enable_z() ;
|
#define enable_z() ;
|
||||||
#define disable_z() ;
|
#define disable_z() ;
|
||||||
#endif
|
#endif
|
||||||
#if E_ENABLE_PIN > -1
|
/*#if E_ENABLE_PIN > -1
|
||||||
#define enable_e() WRITE(E_ENABLE_PIN, E_ENABLE_ON)
|
#define enable_e() WRITE(E_ENABLE_PIN, E_ENABLE_ON)
|
||||||
#define disable_e() WRITE(E_ENABLE_PIN,!E_ENABLE_ON)
|
#define disable_e() WRITE(E_ENABLE_PIN,!E_ENABLE_ON)
|
||||||
#else
|
#else
|
||||||
#define enable_e() ;
|
#define enable_e() ;
|
||||||
#define disable_e() ;
|
#define disable_e() ;
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
void FlushSerialRequestResend();
|
void FlushSerialRequestResend();
|
||||||
void ClearToSend();
|
void ClearToSend();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,21 +222,22 @@ void setup()
|
||||||
|
|
||||||
|
|
||||||
//Initialize Dir Pins
|
//Initialize Dir Pins
|
||||||
#if X_DIR_PIN > -1
|
/* #if X_DIR_PIN > -1
|
||||||
SET_OUTPUT(X_DIR_PIN);
|
SET_OUTPUT(X_DIR_PIN);
|
||||||
#endif
|
#endif
|
||||||
#if Y_DIR_PIN > -1
|
#if Y_DIR_PIN > -1
|
||||||
SET_OUTPUT(Y_DIR_PIN);
|
SET_OUTPUT(Y_DIR_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if Z_DIR_PIN > -1
|
#if Z_DIR_PIN > -1
|
||||||
SET_OUTPUT(Z_DIR_PIN);
|
SET_OUTPUT(Z_DIR_PIN);
|
||||||
#endif
|
#endif
|
||||||
#if E_DIR_PIN > -1
|
/*#if E_DIR_PIN > -1
|
||||||
SET_OUTPUT(E_DIR_PIN);
|
SET_OUTPUT(E_DIR_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
//Initialize Enable Pins - steppers default to disabled.
|
//Initialize Enable Pins - steppers default to disabled.
|
||||||
|
/*
|
||||||
#if (X_ENABLE_PIN > -1)
|
#if (X_ENABLE_PIN > -1)
|
||||||
SET_OUTPUT(X_ENABLE_PIN);
|
SET_OUTPUT(X_ENABLE_PIN);
|
||||||
if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
|
if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
|
||||||
|
|
@ -245,22 +246,23 @@ void setup()
|
||||||
SET_OUTPUT(Y_ENABLE_PIN);
|
SET_OUTPUT(Y_ENABLE_PIN);
|
||||||
if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
|
if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if (Z_ENABLE_PIN > -1)
|
#if (Z_ENABLE_PIN > -1)
|
||||||
SET_OUTPUT(Z_ENABLE_PIN);
|
SET_OUTPUT(Z_ENABLE_PIN);
|
||||||
if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH);
|
if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
#if (E_ENABLE_PIN > -1)
|
/*#if (E_ENABLE_PIN > -1)
|
||||||
SET_OUTPUT(E_ENABLE_PIN);
|
SET_OUTPUT(E_ENABLE_PIN);
|
||||||
if(!E_ENABLE_ON) WRITE(E_ENABLE_PIN,HIGH);
|
if(!E_ENABLE_ON) WRITE(E_ENABLE_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#ifdef CONTROLLERFAN_PIN
|
#ifdef CONTROLLERFAN_PIN
|
||||||
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
|
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//endstops and pullups
|
//endstops and pullups
|
||||||
#ifdef ENDSTOPPULLUPS
|
#ifdef ENDSTOPPULLUPS
|
||||||
#if X_MIN_PIN > -1
|
/*#if X_MIN_PIN > -1
|
||||||
SET_INPUT(X_MIN_PIN);
|
SET_INPUT(X_MIN_PIN);
|
||||||
WRITE(X_MIN_PIN,HIGH);
|
WRITE(X_MIN_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -276,6 +278,7 @@ void setup()
|
||||||
SET_INPUT(Y_MAX_PIN);
|
SET_INPUT(Y_MAX_PIN);
|
||||||
WRITE(Y_MAX_PIN,HIGH);
|
WRITE(Y_MAX_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if Z_MIN_PIN > -1
|
#if Z_MIN_PIN > -1
|
||||||
SET_INPUT(Z_MIN_PIN);
|
SET_INPUT(Z_MIN_PIN);
|
||||||
WRITE(Z_MIN_PIN,HIGH);
|
WRITE(Z_MIN_PIN,HIGH);
|
||||||
|
|
@ -285,7 +288,7 @@ void setup()
|
||||||
WRITE(Z_MAX_PIN,HIGH);
|
WRITE(Z_MAX_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if X_MIN_PIN > -1
|
/*#if X_MIN_PIN > -1
|
||||||
SET_INPUT(X_MIN_PIN);
|
SET_INPUT(X_MIN_PIN);
|
||||||
#endif
|
#endif
|
||||||
#if X_MAX_PIN > -1
|
#if X_MAX_PIN > -1
|
||||||
|
|
@ -297,6 +300,7 @@ void setup()
|
||||||
#if Y_MAX_PIN > -1
|
#if Y_MAX_PIN > -1
|
||||||
SET_INPUT(Y_MAX_PIN);
|
SET_INPUT(Y_MAX_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if Z_MIN_PIN > -1
|
#if Z_MIN_PIN > -1
|
||||||
SET_INPUT(Z_MIN_PIN);
|
SET_INPUT(Z_MIN_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -309,11 +313,11 @@ void setup()
|
||||||
SET_OUTPUT(HEATER_0_PIN);
|
SET_OUTPUT(HEATER_0_PIN);
|
||||||
WRITE(HEATER_0_PIN,LOW);
|
WRITE(HEATER_0_PIN,LOW);
|
||||||
#endif
|
#endif
|
||||||
#if (HEATER_1_PIN > -1)
|
/*#if (HEATER_1_PIN > -1)
|
||||||
SET_OUTPUT(HEATER_1_PIN);
|
SET_OUTPUT(HEATER_1_PIN);
|
||||||
WRITE(HEATER_1_PIN,LOW);
|
WRITE(HEATER_1_PIN,LOW);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
//Initialize Fan Pin
|
//Initialize Fan Pin
|
||||||
#if (FAN_PIN > -1)
|
#if (FAN_PIN > -1)
|
||||||
SET_OUTPUT(FAN_PIN);
|
SET_OUTPUT(FAN_PIN);
|
||||||
|
|
@ -332,18 +336,20 @@ void setup()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Initialize Step Pins
|
//Initialize Step Pins
|
||||||
#if (X_STEP_PIN > -1)
|
/*#if (X_STEP_PIN > -1)
|
||||||
SET_OUTPUT(X_STEP_PIN);
|
SET_OUTPUT(X_STEP_PIN);
|
||||||
#endif
|
#endif
|
||||||
#if (Y_STEP_PIN > -1)
|
#if (Y_STEP_PIN > -1)
|
||||||
SET_OUTPUT(Y_STEP_PIN);
|
SET_OUTPUT(Y_STEP_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if (Z_STEP_PIN > -1)
|
#if (Z_STEP_PIN > -1)
|
||||||
SET_OUTPUT(Z_STEP_PIN);
|
SET_OUTPUT(Z_STEP_PIN);
|
||||||
#endif
|
#endif
|
||||||
#if (E_STEP_PIN > -1)
|
/*#if (E_STEP_PIN > -1)
|
||||||
SET_OUTPUT(E_STEP_PIN);
|
SET_OUTPUT(E_STEP_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#ifdef RAMP_ACCELERATION
|
#ifdef RAMP_ACCELERATION
|
||||||
setup_acceleration();
|
setup_acceleration();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -582,7 +588,7 @@ inline void process_commands()
|
||||||
|
|
||||||
home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
|
home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
|
||||||
|
|
||||||
if((home_all_axis) || (code_seen(axis_codes[0]))) {
|
/* if((home_all_axis) || (code_seen(axis_codes[0]))) {
|
||||||
if ((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)){
|
if ((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)){
|
||||||
current_position[0] = -1.5 * X_MAX_LENGTH * X_HOME_DIR;
|
current_position[0] = -1.5 * X_MAX_LENGTH * X_HOME_DIR;
|
||||||
destination[0] = 0;
|
destination[0] = 0;
|
||||||
|
|
@ -624,7 +630,7 @@ inline void process_commands()
|
||||||
feedrate = 0;
|
feedrate = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if((home_all_axis) || (code_seen(axis_codes[2]))) {
|
if((home_all_axis) || (code_seen(axis_codes[2]))) {
|
||||||
if ((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)){
|
if ((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)){
|
||||||
current_position[2] = -1.5 * Z_MAX_LENGTH * Z_HOME_DIR;
|
current_position[2] = -1.5 * Z_MAX_LENGTH * Z_HOME_DIR;
|
||||||
|
|
@ -922,7 +928,7 @@ inline void process_commands()
|
||||||
break;
|
break;
|
||||||
case 84:
|
case 84:
|
||||||
if(code_seen('S')){ stepper_inactive_time = code_value() * 1000; }
|
if(code_seen('S')){ stepper_inactive_time = code_value() * 1000; }
|
||||||
else{ disable_x(); disable_y(); disable_z(); disable_e(); }
|
else{ /*disable_x(); disable_y();*/ disable_z(); /*disable_e();*/ }
|
||||||
break;
|
break;
|
||||||
case 85: // M85
|
case 85: // M85
|
||||||
code_seen('S');
|
code_seen('S');
|
||||||
|
|
@ -953,7 +959,7 @@ inline void process_commands()
|
||||||
Serial.println(current_position[3]);
|
Serial.println(current_position[3]);
|
||||||
break;
|
break;
|
||||||
case 119: // M119
|
case 119: // M119
|
||||||
#if (X_MIN_PIN > -1)
|
/* #if (X_MIN_PIN > -1)
|
||||||
Serial.print("x_min:");
|
Serial.print("x_min:");
|
||||||
Serial.print((READ(X_MIN_PIN)^X_ENDSTOP_INVERT)?"H ":"L ");
|
Serial.print((READ(X_MIN_PIN)^X_ENDSTOP_INVERT)?"H ":"L ");
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -969,6 +975,7 @@ inline void process_commands()
|
||||||
Serial.print("y_max:");
|
Serial.print("y_max:");
|
||||||
Serial.print((READ(Y_MAX_PIN)^Y_ENDSTOP_INVERT)?"H ":"L ");
|
Serial.print((READ(Y_MAX_PIN)^Y_ENDSTOP_INVERT)?"H ":"L ");
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if (Z_MIN_PIN > -1)
|
#if (Z_MIN_PIN > -1)
|
||||||
Serial.print("z_min:");
|
Serial.print("z_min:");
|
||||||
Serial.print((READ(Z_MIN_PIN)^Z_ENDSTOP_INVERT)?"H ":"L ");
|
Serial.print((READ(Z_MIN_PIN)^Z_ENDSTOP_INVERT)?"H ":"L ");
|
||||||
|
|
@ -1045,35 +1052,38 @@ void prepare_move()
|
||||||
|
|
||||||
|
|
||||||
if (min_software_endstops) {
|
if (min_software_endstops) {
|
||||||
if (destination[0] < 0) destination[0] = 0.0;
|
// if (destination[0] < 0) destination[0] = 0.0;
|
||||||
if (destination[1] < 0) destination[1] = 0.0;
|
// if (destination[1] < 0) destination[1] = 0.0;
|
||||||
if (destination[2] < 0) destination[2] = 0.0;
|
if (destination[2] < 0) destination[2] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_software_endstops) {
|
if (max_software_endstops) {
|
||||||
if (destination[0] > X_MAX_LENGTH) destination[0] = X_MAX_LENGTH;
|
// if (destination[0] > X_MAX_LENGTH) destination[0] = X_MAX_LENGTH;
|
||||||
if (destination[1] > Y_MAX_LENGTH) destination[1] = Y_MAX_LENGTH;
|
// if (destination[1] > Y_MAX_LENGTH) destination[1] = Y_MAX_LENGTH;
|
||||||
if (destination[2] > Z_MAX_LENGTH) destination[2] = Z_MAX_LENGTH;
|
if (destination[2] > Z_MAX_LENGTH) destination[2] = Z_MAX_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destination[0]=destination[1]=destination[3]=0.0;
|
||||||
|
current_position[0]=current_position[1]=current_position[3]=0.0;
|
||||||
|
|
||||||
for(int i=0; i < NUM_AXIS; i++) {
|
for(int i=0; i < NUM_AXIS; i++) {
|
||||||
axis_diff[i] = destination[i] - current_position[i];
|
axis_diff[i] = destination[i] - current_position[i];
|
||||||
move_steps_to_take[i] = abs(axis_diff[i]) * axis_steps_per_unit[i];
|
move_steps_to_take[i] = abs(axis_diff[i]) * axis_steps_per_unit[i];
|
||||||
}
|
}
|
||||||
if(feedrate < 10)
|
if(feedrate < 10)
|
||||||
feedrate = 10;
|
feedrate = 10;
|
||||||
|
|
||||||
//Feedrate calc based on XYZ travel distance
|
//Feedrate calc based on XYZ travel distance
|
||||||
float xy_d;
|
float xy_d;
|
||||||
//Check for cases where only one axis is moving - handle those without float sqrt
|
//Check for cases where only one axis is moving - handle those without float sqrt
|
||||||
if(abs(axis_diff[0]) > 0 && abs(axis_diff[1]) == 0 && abs(axis_diff[2])==0)
|
/* if(abs(axis_diff[0]) > 0 && abs(axis_diff[1]) == 0 && abs(axis_diff[2])==0)
|
||||||
d=abs(axis_diff[0]);
|
d=abs(axis_diff[0]);
|
||||||
else if(abs(axis_diff[0]) == 0 && abs(axis_diff[1]) > 0 && abs(axis_diff[2])==0)
|
else if(abs(axis_diff[0]) == 0 && abs(axis_diff[1]) > 0 && abs(axis_diff[2])==0)
|
||||||
d=abs(axis_diff[1]);
|
d=abs(axis_diff[1]);
|
||||||
else if(abs(axis_diff[0]) == 0 && abs(axis_diff[1]) == 0 && abs(axis_diff[2])>0)
|
else if(abs(axis_diff[0]) == 0 && abs(axis_diff[1]) == 0 && abs(axis_diff[2])>0)
|
||||||
|
*/
|
||||||
d=abs(axis_diff[2]);
|
d=abs(axis_diff[2]);
|
||||||
//two or three XYZ axes moving
|
//two or three XYZ axes moving
|
||||||
else if(abs(axis_diff[0]) > 0 || abs(axis_diff[1]) > 0) { //X or Y or both
|
/* else if(abs(axis_diff[0]) > 0 || abs(axis_diff[1]) > 0) { //X or Y or both
|
||||||
xy_d = sqrt(axis_diff[0] * axis_diff[0] + axis_diff[1] * axis_diff[1]);
|
xy_d = sqrt(axis_diff[0] * axis_diff[0] + axis_diff[1] * axis_diff[1]);
|
||||||
//check if Z involved - if so interpolate that too
|
//check if Z involved - if so interpolate that too
|
||||||
d = (abs(axis_diff[2])>0)?sqrt(xy_d * xy_d + axis_diff[2] * axis_diff[2]):xy_d;
|
d = (abs(axis_diff[2])>0)?sqrt(xy_d * xy_d + axis_diff[2] * axis_diff[2]):xy_d;
|
||||||
|
|
@ -1081,6 +1091,8 @@ void prepare_move()
|
||||||
else if(abs(axis_diff[3]) > 0)
|
else if(abs(axis_diff[3]) > 0)
|
||||||
d = abs(axis_diff[3]);
|
d = abs(axis_diff[3]);
|
||||||
else{ //zero length move
|
else{ //zero length move
|
||||||
|
*/
|
||||||
|
if(d==0){
|
||||||
#ifdef DEBUG_PREPARE_MOVE
|
#ifdef DEBUG_PREPARE_MOVE
|
||||||
|
|
||||||
log_message("_PREPARE_MOVE - No steps to take!");
|
log_message("_PREPARE_MOVE - No steps to take!");
|
||||||
|
|
@ -1120,30 +1132,35 @@ void prepare_move()
|
||||||
inline void linear_move(unsigned long axis_steps_remaining[]) // make linear move with preset speeds and destinations, see G0 and G1
|
inline void linear_move(unsigned long axis_steps_remaining[]) // make linear move with preset speeds and destinations, see G0 and G1
|
||||||
{
|
{
|
||||||
//Determine direction of movement
|
//Determine direction of movement
|
||||||
if (destination[0] > current_position[0]) WRITE(X_DIR_PIN,!INVERT_X_DIR);
|
/* if (destination[0] > current_position[0]) WRITE(X_DIR_PIN,!INVERT_X_DIR);
|
||||||
else WRITE(X_DIR_PIN,INVERT_X_DIR);
|
else WRITE(X_DIR_PIN,INVERT_X_DIR);
|
||||||
if (destination[1] > current_position[1]) WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
|
if (destination[1] > current_position[1]) WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
|
||||||
else WRITE(Y_DIR_PIN,INVERT_Y_DIR);
|
else WRITE(Y_DIR_PIN,INVERT_Y_DIR);
|
||||||
|
*/
|
||||||
if (destination[2] > current_position[2]) WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
|
if (destination[2] > current_position[2]) WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
|
||||||
else WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
else WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
||||||
if (destination[3] > current_position[3]) WRITE(E_DIR_PIN,!INVERT_E_DIR);
|
/* if (destination[3] > current_position[3]) WRITE(E_DIR_PIN,!INVERT_E_DIR);
|
||||||
else WRITE(E_DIR_PIN,INVERT_E_DIR);
|
else WRITE(E_DIR_PIN,INVERT_E_DIR);
|
||||||
|
*/
|
||||||
movereset:
|
movereset:
|
||||||
#if (X_MIN_PIN > -1)
|
/* #if (X_MIN_PIN > -1)
|
||||||
if(!move_direction[0]) if(READ(X_MIN_PIN) != X_ENDSTOP_INVERT) axis_steps_remaining[0]=0;
|
if(!move_direction[0]) if(READ(X_MIN_PIN) != X_ENDSTOP_INVERT) axis_steps_remaining[0]=0;
|
||||||
#endif
|
#endif
|
||||||
#if (Y_MIN_PIN > -1)
|
#if (Y_MIN_PIN > -1)
|
||||||
if(!move_direction[1]) if(READ(Y_MIN_PIN) != Y_ENDSTOP_INVERT) axis_steps_remaining[1]=0;
|
if(!move_direction[1]) if(READ(Y_MIN_PIN) != Y_ENDSTOP_INVERT) axis_steps_remaining[1]=0;
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if (Z_MIN_PIN > -1)
|
#if (Z_MIN_PIN > -1)
|
||||||
if(!move_direction[2]) if(READ(Z_MIN_PIN) != Z_ENDSTOP_INVERT) axis_steps_remaining[2]=0;
|
if(!move_direction[2]) if(READ(Z_MIN_PIN) != Z_ENDSTOP_INVERT) axis_steps_remaining[2]=0;
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
#if (X_MAX_PIN > -1)
|
#if (X_MAX_PIN > -1)
|
||||||
if(move_direction[0]) if(READ(X_MAX_PIN) != X_ENDSTOP_INVERT) axis_steps_remaining[0]=0;
|
if(move_direction[0]) if(READ(X_MAX_PIN) != X_ENDSTOP_INVERT) axis_steps_remaining[0]=0;
|
||||||
#endif
|
#endif
|
||||||
#if (Y_MAX_PIN > -1)
|
#if (Y_MAX_PIN > -1)
|
||||||
if(move_direction[1]) if(READ(Y_MAX_PIN) != Y_ENDSTOP_INVERT) axis_steps_remaining[1]=0;
|
if(move_direction[1]) if(READ(Y_MAX_PIN) != Y_ENDSTOP_INVERT) axis_steps_remaining[1]=0;
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
# if(Z_MAX_PIN > -1)
|
# if(Z_MAX_PIN > -1)
|
||||||
if(move_direction[2]) if(READ(Z_MAX_PIN) != Z_ENDSTOP_INVERT) axis_steps_remaining[2]=0;
|
if(move_direction[2]) if(READ(Z_MAX_PIN) != Z_ENDSTOP_INVERT) axis_steps_remaining[2]=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1152,11 +1169,13 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.
|
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.
|
||||||
// TODO: maybe it's better to refactor into a generic enable(int axis) function, that will probably take more ram,
|
// TODO: maybe it's better to refactor into a generic enable(int axis) function, that will probably take more ram,
|
||||||
// but will reduce code size
|
// but will reduce code size
|
||||||
if(axis_steps_remaining[0]) enable_x();
|
/*if(axis_steps_remaining[0]) enable_x();
|
||||||
if(axis_steps_remaining[1]) enable_y();
|
if(axis_steps_remaining[1]) enable_y();
|
||||||
|
*/
|
||||||
if(axis_steps_remaining[2]) enable_z();
|
if(axis_steps_remaining[2]) enable_z();
|
||||||
|
/*
|
||||||
if(axis_steps_remaining[3]) enable_e();
|
if(axis_steps_remaining[3]) enable_e();
|
||||||
|
*/
|
||||||
//Define variables that are needed for the Bresenham algorithm. Please note that Z is not currently included in the Bresenham algorithm.
|
//Define variables that are needed for the Bresenham algorithm. Please note that Z is not currently included in the Bresenham algorithm.
|
||||||
unsigned long delta[] = {axis_steps_remaining[0], axis_steps_remaining[1], axis_steps_remaining[2], axis_steps_remaining[3]}; //TODO: implement a "for" to support N axes
|
unsigned long delta[] = {axis_steps_remaining[0], axis_steps_remaining[1], axis_steps_remaining[2], axis_steps_remaining[3]}; //TODO: implement a "for" to support N axes
|
||||||
long axis_error[NUM_AXIS];
|
long axis_error[NUM_AXIS];
|
||||||
|
|
@ -1320,7 +1339,7 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
|
|
||||||
//If there are x or y steps remaining, perform Bresenham algorithm
|
//If there are x or y steps remaining, perform Bresenham algorithm
|
||||||
if(axis_steps_remaining[primary_axis]) {
|
if(axis_steps_remaining[primary_axis]) {
|
||||||
#if (X_MIN_PIN > -1)
|
/* #if (X_MIN_PIN > -1)
|
||||||
if(!move_direction[0]) if(READ(X_MIN_PIN) != X_ENDSTOP_INVERT) if(primary_axis==0) break; else if(axis_steps_remaining[0]) axis_steps_remaining[0]=0;
|
if(!move_direction[0]) if(READ(X_MIN_PIN) != X_ENDSTOP_INVERT) if(primary_axis==0) break; else if(axis_steps_remaining[0]) axis_steps_remaining[0]=0;
|
||||||
#endif
|
#endif
|
||||||
#if (Y_MIN_PIN > -1)
|
#if (Y_MIN_PIN > -1)
|
||||||
|
|
@ -1332,6 +1351,7 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
#if (Y_MAX_PIN > -1)
|
#if (Y_MAX_PIN > -1)
|
||||||
if(move_direction[1]) if(READ(Y_MAX_PIN) != Y_ENDSTOP_INVERT) if(primary_axis==1) break; else if(axis_steps_remaining[1]) axis_steps_remaining[1]=0;
|
if(move_direction[1]) if(READ(Y_MAX_PIN) != Y_ENDSTOP_INVERT) if(primary_axis==1) break; else if(axis_steps_remaining[1]) axis_steps_remaining[1]=0;
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#if (Z_MIN_PIN > -1)
|
#if (Z_MIN_PIN > -1)
|
||||||
if(!move_direction[2]) if(READ(Z_MIN_PIN) != Z_ENDSTOP_INVERT) if(primary_axis==2) break; else if(axis_steps_remaining[2]) axis_steps_remaining[2]=0;
|
if(!move_direction[2]) if(READ(Z_MIN_PIN) != Z_ENDSTOP_INVERT) if(primary_axis==2) break; else if(axis_steps_remaining[2]) axis_steps_remaining[2]=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1369,11 +1389,12 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
log_ulong("_MOVE_TIME - This move took", micros()-startmove);
|
log_ulong("_MOVE_TIME - This move took", micros()-startmove);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(DISABLE_X) disable_x();
|
/*if(DISABLE_X) disable_x();
|
||||||
if(DISABLE_Y) disable_y();
|
if(DISABLE_Y) disable_y();
|
||||||
|
*/
|
||||||
if(DISABLE_Z) disable_z();
|
if(DISABLE_Z) disable_z();
|
||||||
if(DISABLE_E) disable_e();
|
/*if(DISABLE_E) disable_e();
|
||||||
|
*/
|
||||||
// Update current position partly based on direction, we probably can combine this with the direction code above...
|
// Update current position partly based on direction, we probably can combine this with the direction code above...
|
||||||
for(int i=0; i < NUM_AXIS; i++) {
|
for(int i=0; i < NUM_AXIS; i++) {
|
||||||
if (destination[i] > current_position[i]) current_position[i] = current_position[i] + steps_taken[i] / axis_steps_per_unit[i];
|
if (destination[i] > current_position[i]) current_position[i] = current_position[i] + steps_taken[i] / axis_steps_per_unit[i];
|
||||||
|
|
@ -1383,24 +1404,28 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
|
|
||||||
void do_step(int axis) {
|
void do_step(int axis) {
|
||||||
switch(axis){
|
switch(axis){
|
||||||
case 0:
|
/*case 0:
|
||||||
WRITE(X_STEP_PIN, HIGH);
|
WRITE(X_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
WRITE(Y_STEP_PIN, HIGH);
|
WRITE(Y_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case 2:
|
case 2:
|
||||||
WRITE(Z_STEP_PIN, HIGH);
|
WRITE(Z_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
case 3:
|
/*case 3:
|
||||||
WRITE(E_STEP_PIN, HIGH);
|
WRITE(E_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
steps_taken[axis]+=1;
|
steps_taken[axis]+=1;
|
||||||
WRITE(X_STEP_PIN, LOW);
|
/*WRITE(X_STEP_PIN, LOW);
|
||||||
WRITE(Y_STEP_PIN, LOW);
|
WRITE(Y_STEP_PIN, LOW);
|
||||||
|
*/
|
||||||
WRITE(Z_STEP_PIN, LOW);
|
WRITE(Z_STEP_PIN, LOW);
|
||||||
WRITE(E_STEP_PIN, LOW);
|
/* WRITE(E_STEP_PIN, LOW);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HEAT_INTERVAL 250
|
#define HEAT_INTERVAL 250
|
||||||
|
|
@ -1715,18 +1740,18 @@ inline void kill()
|
||||||
target_bed_raw=0;
|
target_bed_raw=0;
|
||||||
if(HEATER_1_PIN > -1) WRITE(HEATER_1_PIN,LOW);
|
if(HEATER_1_PIN > -1) WRITE(HEATER_1_PIN,LOW);
|
||||||
#endif
|
#endif
|
||||||
disable_x();
|
/* disable_x();
|
||||||
disable_y();
|
disable_y();
|
||||||
disable_z();
|
*/ disable_z();
|
||||||
disable_e();
|
/* disable_e();
|
||||||
|
*/
|
||||||
if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
|
if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void manage_inactivity(byte debug) {
|
inline void manage_inactivity(byte debug) {
|
||||||
if( (millis()-previous_millis_cmd) > max_inactive_time ) if(max_inactive_time) kill();
|
if( (millis()-previous_millis_cmd) > max_inactive_time ) if(max_inactive_time) kill();
|
||||||
if( (millis()-previous_millis_cmd) > stepper_inactive_time ) if(stepper_inactive_time) { disable_x(); disable_y(); disable_z(); disable_e(); }
|
if( (millis()-previous_millis_cmd) > stepper_inactive_time ) if(stepper_inactive_time) { /*disable_x(); disable_y();*/ disable_z(); /*disable_e();*/ }
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RAMP_ACCELERATION
|
#ifdef RAMP_ACCELERATION
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,351 @@ pins
|
||||||
#define PD7_DDR DDRD
|
#define PD7_DDR DDRD
|
||||||
#define PD7_PWM NULL
|
#define PD7_PWM NULL
|
||||||
#endif /* _AVR_ATmega{168,328,328P}__ */
|
#endif /* _AVR_ATmega{168,328,328P}__ */
|
||||||
|
#if defined (__AVR_ATmega32U4__ ) //Teensy 2.0
|
||||||
|
// UART
|
||||||
|
#define RXD DIO7
|
||||||
|
#define TXD DIO8
|
||||||
|
|
||||||
|
// SPI
|
||||||
|
#define SCK DIO1
|
||||||
|
#define MISO DIO3
|
||||||
|
#define MOSI DIO2
|
||||||
|
#define SS DIO0
|
||||||
|
|
||||||
|
// TWI (I2C)
|
||||||
|
#define SCL DIO5
|
||||||
|
#define SDA DIO6
|
||||||
|
|
||||||
|
|
||||||
|
#define DEBUG_LED DIO11
|
||||||
|
|
||||||
|
/*
|
||||||
|
pins
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DIO0_PIN PINB0
|
||||||
|
#define DIO0_RPORT PINB
|
||||||
|
#define DIO0_WPORT PORTB
|
||||||
|
#define DIO0_DDR DDRB
|
||||||
|
#define DIO0_PWM NULL
|
||||||
|
|
||||||
|
#define DIO1_PIN PINB1
|
||||||
|
#define DIO1_RPORT PINB
|
||||||
|
#define DIO1_WPORT PORTB
|
||||||
|
#define DIO1_DDR DDRB
|
||||||
|
#define DIO1_PWM NULL
|
||||||
|
|
||||||
|
#define DIO2_PIN PINB2
|
||||||
|
#define DIO2_RPORT PINB
|
||||||
|
#define DIO2_WPORT PORTB
|
||||||
|
#define DIO2_DDR DDRB
|
||||||
|
#define DIO2_PWM NULL
|
||||||
|
|
||||||
|
#define DIO3_PIN PINB3
|
||||||
|
#define DIO3_RPORT PINB
|
||||||
|
#define DIO3_WPORT PORTB
|
||||||
|
#define DIO3_DDR DDRB
|
||||||
|
#define DIO3_PWM NULL
|
||||||
|
|
||||||
|
#define DIO4_PIN PINB7
|
||||||
|
#define DIO4_RPORT PINB
|
||||||
|
#define DIO4_WPORT PORTB
|
||||||
|
#define DIO4_DDR DDRB
|
||||||
|
#define DIO4_PWM NULL
|
||||||
|
|
||||||
|
#define DIO5_PIN PIND0
|
||||||
|
#define DIO5_RPORT PIND
|
||||||
|
#define DIO5_WPORT PORTD
|
||||||
|
#define DIO5_DDR DDRD
|
||||||
|
#define DIO5_PWM NULL
|
||||||
|
|
||||||
|
#define DIO6_PIN PIND1
|
||||||
|
#define DIO6_RPORT PIND
|
||||||
|
#define DIO6_WPORT PORTD
|
||||||
|
#define DIO6_DDR DDRD
|
||||||
|
#define DIO6_PWM NULL
|
||||||
|
|
||||||
|
#define DIO7_PIN PIND2
|
||||||
|
#define DIO7_RPORT PIND
|
||||||
|
#define DIO7_WPORT PORTD
|
||||||
|
#define DIO7_DDR DDRD
|
||||||
|
#define DIO7_PWM NULL
|
||||||
|
|
||||||
|
#define DIO8_PIN PIND3
|
||||||
|
#define DIO8_RPORT PIND
|
||||||
|
#define DIO8_WPORT PORTD
|
||||||
|
#define DIO8_DDR DDRD
|
||||||
|
#define DIO8_PWM NULL
|
||||||
|
|
||||||
|
#define DIO9_PIN PINC6
|
||||||
|
#define DIO9_RPORT PINC
|
||||||
|
#define DIO9_WPORT PORTC
|
||||||
|
#define DIO9_DDR DDRC
|
||||||
|
#define DIO9_PWM NULL
|
||||||
|
|
||||||
|
#define DIO10_PIN PINC7
|
||||||
|
#define DIO10_RPORT PINC
|
||||||
|
#define DIO10_WPORT PORTC
|
||||||
|
#define DIO10_DDR DDRC
|
||||||
|
#define DIO10_PWM NULL
|
||||||
|
|
||||||
|
#define DIO11_PIN PIND6
|
||||||
|
#define DIO11_RPORT PIND
|
||||||
|
#define DIO11_WPORT PORTD
|
||||||
|
#define DIO11_DDR DDRD
|
||||||
|
#define DIO11_PWM NULL
|
||||||
|
|
||||||
|
#define DIO12_PIN PIND7
|
||||||
|
#define DIO12_RPORT PIND
|
||||||
|
#define DIO12_WPORT PORTD
|
||||||
|
#define DIO12_DDR DDRD
|
||||||
|
#define DIO12_PWM NULL
|
||||||
|
|
||||||
|
#define DIO13_PIN PINB4
|
||||||
|
#define DIO13_RPORT PINB
|
||||||
|
#define DIO13_WPORT PORTB
|
||||||
|
#define DIO13_DDR DDRB
|
||||||
|
#define DIO13_PWM NULL
|
||||||
|
|
||||||
|
|
||||||
|
#define DIO14_PIN PINB5
|
||||||
|
#define DIO14_RPORT PINB
|
||||||
|
#define DIO14_WPORT PORTB
|
||||||
|
#define DIO14_DDR DDRB
|
||||||
|
#define DIO14_PWM NULL
|
||||||
|
|
||||||
|
#define DIO15_PIN PINB6
|
||||||
|
#define DIO15_RPORT PINB
|
||||||
|
#define DIO15_WPORT PORTB
|
||||||
|
#define DIO15_DDR DDRB
|
||||||
|
#define DIO15_PWM NULL
|
||||||
|
|
||||||
|
#define DIO16_PIN PINF7
|
||||||
|
#define DIO16_RPORT PINF
|
||||||
|
#define DIO16_WPORT PORTF
|
||||||
|
#define DIO16_DDR DDRF
|
||||||
|
#define DIO16_PWM NULL
|
||||||
|
|
||||||
|
#define DIO17_PIN PINF6
|
||||||
|
#define DIO17_RPORT PINF
|
||||||
|
#define DIO17_WPORT PORTF
|
||||||
|
#define DIO17_DDR DDRF
|
||||||
|
#define DIO17_PWM NULL
|
||||||
|
|
||||||
|
#define DIO18_PIN PINF5
|
||||||
|
#define DIO18_RPORT PINF
|
||||||
|
#define DIO18_WPORT PORTF
|
||||||
|
#define DIO18_DDR DDRF
|
||||||
|
#define DIO18_PWM NULL
|
||||||
|
|
||||||
|
#define DIO19_PIN PINF4
|
||||||
|
#define DIO19_RPORT PINF
|
||||||
|
#define DIO19_WPORT PORTF
|
||||||
|
#define DIO19_DDR DDRF
|
||||||
|
#define DIO19_PWM NULL
|
||||||
|
|
||||||
|
#define DIO20_PIN PINF1
|
||||||
|
#define DIO20_RPORT PINF
|
||||||
|
#define DIO20_WPORT PORTF
|
||||||
|
#define DIO20_DDR DDRF
|
||||||
|
#define DIO20_PWM NULL
|
||||||
|
|
||||||
|
#define DIO21_PIN PINF0
|
||||||
|
#define DIO21_RPORT PINF
|
||||||
|
#define DIO21_WPORT PORTF
|
||||||
|
#define DIO21_DDR DDRF
|
||||||
|
#define DIO21_PWM NULL
|
||||||
|
|
||||||
|
#define DIO22_PIN PIND4
|
||||||
|
#define DIO22_RPORT PIND
|
||||||
|
#define DIO22_WPORT PORTD
|
||||||
|
#define DIO22_DDR DDRD
|
||||||
|
#define DIO22_PWM NULL
|
||||||
|
|
||||||
|
#define DIO23_PIN PIND5
|
||||||
|
#define DIO23_RPORT PIND
|
||||||
|
#define DIO23_WPORT PORTD
|
||||||
|
#define DIO23_DDR DDRD
|
||||||
|
#define DIO23_PWM NULL
|
||||||
|
|
||||||
|
#define DIO24_PIN PINE6
|
||||||
|
#define DIO24_RPORT PINE
|
||||||
|
#define DIO24_WPORT PORTE
|
||||||
|
#define DIO24_DDR DDRE
|
||||||
|
#define DIO24_PWM NULL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#undef PB0
|
||||||
|
#define PB0_PIN PINB0
|
||||||
|
#define PB0_RPORT PINB
|
||||||
|
#define PB0_WPORT PORTB
|
||||||
|
#define PB0_DDR DDRB
|
||||||
|
#define PB0_PWM NULL
|
||||||
|
|
||||||
|
#undef PB1
|
||||||
|
#define PB1_PIN PINB1
|
||||||
|
#define PB1_RPORT PINB
|
||||||
|
#define PB1_WPORT PORTB
|
||||||
|
#define PB1_DDR DDRB
|
||||||
|
#define PB1_PWM NULL
|
||||||
|
|
||||||
|
#undef PB2
|
||||||
|
#define PB2_PIN PINB2
|
||||||
|
#define PB2_RPORT PINB
|
||||||
|
#define PB2_WPORT PORTB
|
||||||
|
#define PB2_DDR DDRB
|
||||||
|
#define PB2_PWM NULL
|
||||||
|
|
||||||
|
#undef PB3
|
||||||
|
#define PB3_PIN PINB3
|
||||||
|
#define PB3_RPORT PINB
|
||||||
|
#define PB3_WPORT PORTB
|
||||||
|
#define PB3_DDR DDRB
|
||||||
|
#define PB3_PWM NULL
|
||||||
|
|
||||||
|
#undef PB4
|
||||||
|
#define PB4_PIN PINB4
|
||||||
|
#define PB4_RPORT PINB
|
||||||
|
#define PB4_WPORT PORTB
|
||||||
|
#define PB4_DDR DDRB
|
||||||
|
#define PB4_PWM NULL
|
||||||
|
|
||||||
|
#undef PB5
|
||||||
|
#define PB5_PIN PINB5
|
||||||
|
#define PB5_RPORT PINB
|
||||||
|
#define PB5_WPORT PORTB
|
||||||
|
#define PB5_DDR DDRB
|
||||||
|
#define PB5_PWM NULL
|
||||||
|
|
||||||
|
#undef PB6
|
||||||
|
#define PB6_PIN PINB6
|
||||||
|
#define PB6_RPORT PINB
|
||||||
|
#define PB6_WPORT PORTB
|
||||||
|
#define PB6_DDR DDRB
|
||||||
|
#define PB6_PWM NULL
|
||||||
|
|
||||||
|
#undef PB7
|
||||||
|
#define PB7_PIN PINB7
|
||||||
|
#define PB7_RPORT PINB
|
||||||
|
#define PB7_WPORT PORTB
|
||||||
|
#define PB7_DDR DDRB
|
||||||
|
#define PB7_PWM NULL
|
||||||
|
|
||||||
|
|
||||||
|
#undef PC0
|
||||||
|
#define PC0_PIN PINC0
|
||||||
|
#define PC0_RPORT PINC
|
||||||
|
#define PC0_WPORT PORTC
|
||||||
|
#define PC0_DDR DDRC
|
||||||
|
#define PC0_PWM NULL
|
||||||
|
|
||||||
|
#undef PC1
|
||||||
|
#define PC1_PIN PINC1
|
||||||
|
#define PC1_RPORT PINC
|
||||||
|
#define PC1_WPORT PORTC
|
||||||
|
#define PC1_DDR DDRC
|
||||||
|
#define PC1_PWM NULL
|
||||||
|
|
||||||
|
#undef PC2
|
||||||
|
#define PC2_PIN PINC2
|
||||||
|
#define PC2_RPORT PINC
|
||||||
|
#define PC2_WPORT PORTC
|
||||||
|
#define PC2_DDR DDRC
|
||||||
|
#define PC2_PWM NULL
|
||||||
|
|
||||||
|
#undef PC3
|
||||||
|
#define PC3_PIN PINC3
|
||||||
|
#define PC3_RPORT PINC
|
||||||
|
#define PC3_WPORT PORTC
|
||||||
|
#define PC3_DDR DDRC
|
||||||
|
#define PC3_PWM NULL
|
||||||
|
|
||||||
|
#undef PC4
|
||||||
|
#define PC4_PIN PINC4
|
||||||
|
#define PC4_RPORT PINC
|
||||||
|
#define PC4_WPORT PORTC
|
||||||
|
#define PC4_DDR DDRC
|
||||||
|
#define PC4_PWM NULL
|
||||||
|
|
||||||
|
#undef PC5
|
||||||
|
#define PC5_PIN PINC5
|
||||||
|
#define PC5_RPORT PINC
|
||||||
|
#define PC5_WPORT PORTC
|
||||||
|
#define PC5_DDR DDRC
|
||||||
|
#define PC5_PWM NULL
|
||||||
|
|
||||||
|
#undef PC6
|
||||||
|
#define PC6_PIN PINC6
|
||||||
|
#define PC6_RPORT PINC
|
||||||
|
#define PC6_WPORT PORTC
|
||||||
|
#define PC6_DDR DDRC
|
||||||
|
#define PC6_PWM NULL
|
||||||
|
|
||||||
|
#undef PC7
|
||||||
|
#define PC7_PIN PINC7
|
||||||
|
#define PC7_RPORT PINC
|
||||||
|
#define PC7_WPORT PORTC
|
||||||
|
#define PC7_DDR DDRC
|
||||||
|
#define PC7_PWM NULL
|
||||||
|
|
||||||
|
|
||||||
|
#undef PD0
|
||||||
|
#define PD0_PIN PIND0
|
||||||
|
#define PD0_RPORT PIND
|
||||||
|
#define PD0_WPORT PORTD
|
||||||
|
#define PD0_DDR DDRD
|
||||||
|
#define PD0_PWM NULL
|
||||||
|
|
||||||
|
#undef PD1
|
||||||
|
#define PD1_PIN PIND1
|
||||||
|
#define PD1_RPORT PIND
|
||||||
|
#define PD1_WPORT PORTD
|
||||||
|
#define PD1_DDR DDRD
|
||||||
|
#define PD1_PWM NULL
|
||||||
|
|
||||||
|
#undef PD2
|
||||||
|
#define PD2_PIN PIND2
|
||||||
|
#define PD2_RPORT PIND
|
||||||
|
#define PD2_WPORT PORTD
|
||||||
|
#define PD2_DDR DDRD
|
||||||
|
#define PD2_PWM NULL
|
||||||
|
|
||||||
|
#undef PD3
|
||||||
|
#define PD3_PIN PIND3
|
||||||
|
#define PD3_RPORT PIND
|
||||||
|
#define PD3_WPORT PORTD
|
||||||
|
#define PD3_DDR DDRD
|
||||||
|
#define PD3_PWM NULL
|
||||||
|
|
||||||
|
#undef PD4
|
||||||
|
#define PD4_PIN PIND4
|
||||||
|
#define PD4_RPORT PIND
|
||||||
|
#define PD4_WPORT PORTD
|
||||||
|
#define PD4_DDR DDRD
|
||||||
|
#define PD4_PWM NULL
|
||||||
|
|
||||||
|
#undef PD5
|
||||||
|
#define PD5_PIN PIND5
|
||||||
|
#define PD5_RPORT PIND
|
||||||
|
#define PD5_WPORT PORTD
|
||||||
|
#define PD5_DDR DDRD
|
||||||
|
#define PD5_PWM NULL
|
||||||
|
|
||||||
|
#undef PD6
|
||||||
|
#define PD6_PIN PIND6
|
||||||
|
#define PD6_RPORT PIND
|
||||||
|
#define PD6_WPORT PORTD
|
||||||
|
#define PD6_DDR DDRD
|
||||||
|
#define PD6_PWM NULL
|
||||||
|
|
||||||
|
#undef PD7
|
||||||
|
#define PD7_PIN PIND7
|
||||||
|
#define PD7_RPORT PIND
|
||||||
|
#define PD7_WPORT PORTD
|
||||||
|
#define PD7_DDR DDRD
|
||||||
|
#define PD7_PWM NULL
|
||||||
|
#endif /* __AVR_ATmega32U4__ */
|
||||||
|
|
||||||
#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
|
#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
|
||||||
// UART
|
// UART
|
||||||
|
|
|
||||||
|
|
@ -799,6 +799,53 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MOTHERBOARD == 10 //teensy driving lemon curry
|
||||||
|
#define KNOWN_BOARD 1
|
||||||
|
|
||||||
|
#ifndef __AVR_ATmega32U4__
|
||||||
|
#error Oops! Make sure you have 'Teensy 2.0' selected from the boards menu.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define X_STEP_PIN -1
|
||||||
|
#define X_DIR_PIN -1
|
||||||
|
#define X_ENABLE_PIN -1
|
||||||
|
#define X_MIN_PIN -1
|
||||||
|
#define X_MAX_PIN -1
|
||||||
|
|
||||||
|
#define Y_STEP_PIN -1
|
||||||
|
#define Y_DIR_PIN -1
|
||||||
|
#define Y_ENABLE_PIN -1
|
||||||
|
#define Y_MIN_PIN -1
|
||||||
|
#define Y_MAX_PIN -1
|
||||||
|
|
||||||
|
#define Z_STEP_PIN 10
|
||||||
|
#define Z_DIR_PIN 23
|
||||||
|
#define Z_ENABLE_PIN 22
|
||||||
|
#define Z_MIN_PIN 9
|
||||||
|
#define Z_MAX_PIN -1//16
|
||||||
|
|
||||||
|
#define E_STEP_PIN -1
|
||||||
|
#define E_DIR_PIN -1
|
||||||
|
#define E_ENABLE_PIN -1
|
||||||
|
|
||||||
|
#define SDPOWER -1
|
||||||
|
#define SDSS -1
|
||||||
|
#define LED_PIN 11
|
||||||
|
#define FAN_PIN 14
|
||||||
|
#define PS_ON_PIN -1
|
||||||
|
#define KILL_PIN -1
|
||||||
|
#define ALARM_PIN -1
|
||||||
|
|
||||||
|
#define HEATER_0_PIN 12
|
||||||
|
#define TEMP_0_PIN 9 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
|
||||||
|
#define HEATER_1_PIN -1
|
||||||
|
#define TEMP_1_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef KNOWN_BOARD
|
#ifndef KNOWN_BOARD
|
||||||
#error Unknown MOTHERBOARD value in configuration.h
|
#error Unknown MOTHERBOARD value in configuration.h
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue