|
|
@ -44,7 +44,7 @@
|
|
|
|
#include "Servo.h"
|
|
|
|
#include "Servo.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if DIGIPOTSS_PIN > 0
|
|
|
|
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
|
|
|
|
#include <SPI.h>
|
|
|
|
#include <SPI.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -300,7 +300,7 @@ void enquecommand_P(const char *cmd)
|
|
|
|
|
|
|
|
|
|
|
|
void setup_killpin()
|
|
|
|
void setup_killpin()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if( KILL_PIN>-1 )
|
|
|
|
#if defined(KILL_PIN) && KILL_PIN > -1
|
|
|
|
pinMode(KILL_PIN,INPUT);
|
|
|
|
pinMode(KILL_PIN,INPUT);
|
|
|
|
WRITE(KILL_PIN,HIGH);
|
|
|
|
WRITE(KILL_PIN,HIGH);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -308,50 +308,44 @@ void setup_killpin()
|
|
|
|
|
|
|
|
|
|
|
|
void setup_photpin()
|
|
|
|
void setup_photpin()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef PHOTOGRAPH_PIN
|
|
|
|
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
|
|
|
|
#if (PHOTOGRAPH_PIN > 0)
|
|
|
|
|
|
|
|
SET_OUTPUT(PHOTOGRAPH_PIN);
|
|
|
|
SET_OUTPUT(PHOTOGRAPH_PIN);
|
|
|
|
WRITE(PHOTOGRAPH_PIN, LOW);
|
|
|
|
WRITE(PHOTOGRAPH_PIN, LOW);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setup_powerhold()
|
|
|
|
void setup_powerhold()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef SUICIDE_PIN
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
#if (SUICIDE_PIN> 0)
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
#endif
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
#if (PS_ON_PIN > 0)
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
#endif
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void suicide()
|
|
|
|
void suicide()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef SUICIDE_PIN
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
#if (SUICIDE_PIN > 0)
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
WRITE(SUICIDE_PIN, LOW);
|
|
|
|
WRITE(SUICIDE_PIN, LOW);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void servo_init()
|
|
|
|
void servo_init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if (NUM_SERVOS >= 1) && (SERVO0_PIN > 0)
|
|
|
|
#if (NUM_SERVOS >= 1) && defined(SERVO0_PIN) && (SERVO0_PIN > -1)
|
|
|
|
servos[0].attach(SERVO0_PIN);
|
|
|
|
servos[0].attach(SERVO0_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 2) && (SERVO1_PIN > 0)
|
|
|
|
#if (NUM_SERVOS >= 2) && defined(SERVO1_PIN) && (SERVO1_PIN > -1)
|
|
|
|
servos[1].attach(SERVO1_PIN);
|
|
|
|
servos[1].attach(SERVO1_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 3) && (SERVO2_PIN > 0)
|
|
|
|
#if (NUM_SERVOS >= 3) && defined(SERVO2_PIN) && (SERVO2_PIN > -1)
|
|
|
|
servos[2].attach(SERVO2_PIN);
|
|
|
|
servos[2].attach(SERVO2_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 4) && (SERVO3_PIN > 0)
|
|
|
|
#if (NUM_SERVOS >= 4) && defined(SERVO3_PIN) && (SERVO3_PIN > -1)
|
|
|
|
servos[3].attach(SERVO3_PIN);
|
|
|
|
servos[3].attach(SERVO3_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 5)
|
|
|
|
#if (NUM_SERVOS >= 5)
|
|
|
@ -411,7 +405,7 @@ void setup()
|
|
|
|
|
|
|
|
|
|
|
|
lcd_init();
|
|
|
|
lcd_init();
|
|
|
|
|
|
|
|
|
|
|
|
#if CONTROLLERFAN_PIN > 0
|
|
|
|
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
|
|
|
|
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
|
|
|
|
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -669,7 +663,7 @@ static void axis_is_at_home(int axis) {
|
|
|
|
|
|
|
|
|
|
|
|
static void homeaxis(int axis) {
|
|
|
|
static void homeaxis(int axis) {
|
|
|
|
#define HOMEAXIS_DO(LETTER) \
|
|
|
|
#define HOMEAXIS_DO(LETTER) \
|
|
|
|
((LETTER##_MIN_PIN > 0 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > 0 && LETTER##_HOME_DIR==1))
|
|
|
|
((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
|
|
|
|
|
|
|
|
|
|
|
|
if (axis==X_AXIS ? HOMEAXIS_DO(X) :
|
|
|
|
if (axis==X_AXIS ? HOMEAXIS_DO(X) :
|
|
|
|
axis==Y_AXIS ? HOMEAXIS_DO(Y) :
|
|
|
|
axis==Y_AXIS ? HOMEAXIS_DO(Y) :
|
|
|
@ -1036,7 +1030,7 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if FAN_PIN > 0
|
|
|
|
#if defined(FAN_PIN) && FAN_PIN > -1
|
|
|
|
if (pin_number == FAN_PIN)
|
|
|
|
if (pin_number == FAN_PIN)
|
|
|
|
fanSpeed = pin_status;
|
|
|
|
fanSpeed = pin_status;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1062,12 +1056,12 @@ void process_commands()
|
|
|
|
if(setTargetedHotend(105)){
|
|
|
|
if(setTargetedHotend(105)){
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if (TEMP_0_PIN > 0)
|
|
|
|
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM("ok T:");
|
|
|
|
SERIAL_PROTOCOLPGM("ok T:");
|
|
|
|
SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
|
|
|
|
SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
|
|
|
|
SERIAL_PROTOCOLPGM(" /");
|
|
|
|
SERIAL_PROTOCOLPGM(" /");
|
|
|
|
SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1);
|
|
|
|
SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1);
|
|
|
|
#if TEMP_BED_PIN > 0
|
|
|
|
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(" B:");
|
|
|
|
SERIAL_PROTOCOLPGM(" B:");
|
|
|
|
SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
|
SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
|
SERIAL_PROTOCOLPGM(" /");
|
|
|
|
SERIAL_PROTOCOLPGM(" /");
|
|
|
@ -1165,7 +1159,7 @@ void process_commands()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 190: // M190 - Wait for bed heater to reach target.
|
|
|
|
case 190: // M190 - Wait for bed heater to reach target.
|
|
|
|
#if TEMP_BED_PIN > 0
|
|
|
|
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
|
|
|
LCD_MESSAGEPGM(MSG_BED_HEATING);
|
|
|
|
LCD_MESSAGEPGM(MSG_BED_HEATING);
|
|
|
|
if (code_seen('S')) setTargetBed(code_value());
|
|
|
|
if (code_seen('S')) setTargetBed(code_value());
|
|
|
|
codenum = millis();
|
|
|
|
codenum = millis();
|
|
|
@ -1192,7 +1186,7 @@ void process_commands()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
#if FAN_PIN > 0
|
|
|
|
#if defined(FAN_PIN) && FAN_PIN > -1
|
|
|
|
case 106: //M106 Fan On
|
|
|
|
case 106: //M106 Fan On
|
|
|
|
if (code_seen('S')){
|
|
|
|
if (code_seen('S')){
|
|
|
|
fanSpeed=constrain(code_value(),0,255);
|
|
|
|
fanSpeed=constrain(code_value(),0,255);
|
|
|
@ -1207,7 +1201,7 @@ void process_commands()
|
|
|
|
#endif //FAN_PIN
|
|
|
|
#endif //FAN_PIN
|
|
|
|
#ifdef BARICUDA
|
|
|
|
#ifdef BARICUDA
|
|
|
|
// PWM for HEATER_1_PIN
|
|
|
|
// PWM for HEATER_1_PIN
|
|
|
|
#if HEATER_1_PIN > 0
|
|
|
|
#if defined(HEATER_1_PIN) && HEATER_1_PIN > -1
|
|
|
|
case 126: //M126 valve open
|
|
|
|
case 126: //M126 valve open
|
|
|
|
if (code_seen('S')){
|
|
|
|
if (code_seen('S')){
|
|
|
|
ValvePressure=constrain(code_value(),0,255);
|
|
|
|
ValvePressure=constrain(code_value(),0,255);
|
|
|
@ -1222,7 +1216,7 @@ void process_commands()
|
|
|
|
#endif //HEATER_1_PIN
|
|
|
|
#endif //HEATER_1_PIN
|
|
|
|
|
|
|
|
|
|
|
|
// PWM for HEATER_2_PIN
|
|
|
|
// PWM for HEATER_2_PIN
|
|
|
|
#if HEATER_2_PIN > 0
|
|
|
|
#if defined(HEATER_2_PIN) && HEATER_2_PIN > -1
|
|
|
|
case 128: //M128 valve open
|
|
|
|
case 128: //M128 valve open
|
|
|
|
if (code_seen('S')){
|
|
|
|
if (code_seen('S')){
|
|
|
|
EtoPPressure=constrain(code_value(),0,255);
|
|
|
|
EtoPPressure=constrain(code_value(),0,255);
|
|
|
@ -1237,7 +1231,7 @@ void process_commands()
|
|
|
|
#endif //HEATER_2_PIN
|
|
|
|
#endif //HEATER_2_PIN
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if (PS_ON_PIN > 0)
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
case 80: // M80 - ATX Power On
|
|
|
|
case 80: // M80 - ATX Power On
|
|
|
|
SET_OUTPUT(PS_ON_PIN); //GND
|
|
|
|
SET_OUTPUT(PS_ON_PIN); //GND
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
@ -1246,10 +1240,10 @@ void process_commands()
|
|
|
|
|
|
|
|
|
|
|
|
case 81: // M81 - ATX Power Off
|
|
|
|
case 81: // M81 - ATX Power Off
|
|
|
|
|
|
|
|
|
|
|
|
#if defined SUICIDE_PIN && SUICIDE_PIN > 0
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
|
suicide();
|
|
|
|
suicide();
|
|
|
|
#elif (PS_ON_PIN > 0)
|
|
|
|
#elif defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1354,27 +1348,27 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 119: // M119
|
|
|
|
case 119: // M119
|
|
|
|
SERIAL_PROTOCOLLN(MSG_M119_REPORT);
|
|
|
|
SERIAL_PROTOCOLLN(MSG_M119_REPORT);
|
|
|
|
#if (X_MIN_PIN > 0)
|
|
|
|
#if defined(X_MIN_PIN) && X_MIN_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_X_MIN);
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_X_MIN);
|
|
|
|
SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (X_MAX_PIN > 0)
|
|
|
|
#if defined(X_MAX_PIN) && X_MAX_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_X_MAX);
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_X_MAX);
|
|
|
|
SERIAL_PROTOCOLLN(((READ(X_MAX_PIN)^X_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
SERIAL_PROTOCOLLN(((READ(X_MAX_PIN)^X_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (Y_MIN_PIN > 0)
|
|
|
|
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Y_MIN);
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Y_MIN);
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Y_MIN_PIN)^Y_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Y_MIN_PIN)^Y_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (Y_MAX_PIN > 0)
|
|
|
|
#if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Y_MAX);
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Y_MAX);
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Y_MAX_PIN)^Y_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Y_MAX_PIN)^Y_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (Z_MIN_PIN > 0)
|
|
|
|
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Z_MIN);
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Z_MIN);
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Z_MIN_PIN)^Z_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Z_MIN_PIN)^Z_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (Z_MAX_PIN > 0)
|
|
|
|
#if defined(Z_MAX_PIN) && Z_MAX_PIN > -1
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Z_MAX);
|
|
|
|
SERIAL_PROTOCOLPGM(MSG_Z_MAX);
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Z_MAX_PIN)^Z_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
SERIAL_PROTOCOLLN(((READ(Z_MAX_PIN)^Z_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1612,8 +1606,7 @@ void process_commands()
|
|
|
|
#endif //PIDTEMP
|
|
|
|
#endif //PIDTEMP
|
|
|
|
case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/
|
|
|
|
case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef PHOTOGRAPH_PIN
|
|
|
|
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
|
|
|
|
#if (PHOTOGRAPH_PIN > 0)
|
|
|
|
|
|
|
|
const uint8_t NUM_PULSES=16;
|
|
|
|
const uint8_t NUM_PULSES=16;
|
|
|
|
const float PULSE_LENGTH=0.01524;
|
|
|
|
const float PULSE_LENGTH=0.01524;
|
|
|
|
for(int i=0; i < NUM_PULSES; i++) {
|
|
|
|
for(int i=0; i < NUM_PULSES; i++) {
|
|
|
@ -1629,7 +1622,6 @@ void process_commands()
|
|
|
|
WRITE(PHOTOGRAPH_PIN, LOW);
|
|
|
|
WRITE(PHOTOGRAPH_PIN, LOW);
|
|
|
|
_delay_ms(PULSE_LENGTH);
|
|
|
|
_delay_ms(PULSE_LENGTH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1811,7 +1803,7 @@ void process_commands()
|
|
|
|
#endif //FILAMENTCHANGEENABLE
|
|
|
|
#endif //FILAMENTCHANGEENABLE
|
|
|
|
case 907: // M907 Set digital trimpot motor current using axis codes.
|
|
|
|
case 907: // M907 Set digital trimpot motor current using axis codes.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if DIGIPOTSS_PIN > 0
|
|
|
|
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
|
|
|
|
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_current(i,code_value());
|
|
|
|
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_current(i,code_value());
|
|
|
|
if(code_seen('B')) digipot_current(4,code_value());
|
|
|
|
if(code_seen('B')) digipot_current(4,code_value());
|
|
|
|
if(code_seen('S')) for(int i=0;i<=4;i++) digipot_current(i,code_value());
|
|
|
|
if(code_seen('S')) for(int i=0;i<=4;i++) digipot_current(i,code_value());
|
|
|
@ -1820,7 +1812,7 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 908: // M908 Control digital trimpot directly.
|
|
|
|
case 908: // M908 Control digital trimpot directly.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if DIGIPOTSS_PIN > 0
|
|
|
|
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
|
|
|
|
uint8_t channel,current;
|
|
|
|
uint8_t channel,current;
|
|
|
|
if(code_seen('P')) channel=code_value();
|
|
|
|
if(code_seen('P')) channel=code_value();
|
|
|
|
if(code_seen('S')) current=code_value();
|
|
|
|
if(code_seen('S')) current=code_value();
|
|
|
@ -1830,7 +1822,7 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
|
|
|
|
case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if X_MS1_PIN > 0
|
|
|
|
#if defined(X_MS1_PIN) && X_MS1_PIN > -1
|
|
|
|
if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value());
|
|
|
|
if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value());
|
|
|
|
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_mode(i,(uint8_t)code_value());
|
|
|
|
for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) microstep_mode(i,(uint8_t)code_value());
|
|
|
|
if(code_seen('B')) microstep_mode(4,code_value());
|
|
|
|
if(code_seen('B')) microstep_mode(4,code_value());
|
|
|
@ -1840,7 +1832,7 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
|
|
|
|
case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if X_MS1_PIN > 0
|
|
|
|
#if defined(X_MS1_PIN) && X_MS1_PIN > -1
|
|
|
|
if(code_seen('S')) switch((int)code_value())
|
|
|
|
if(code_seen('S')) switch((int)code_value())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
@ -2064,10 +2056,12 @@ void prepare_arc_move(char isclockwise) {
|
|
|
|
previous_millis_cmd = millis();
|
|
|
|
previous_millis_cmd = millis();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if CONTROLLERFAN_PIN > 0
|
|
|
|
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
|
|
|
|
|
|
|
|
|
|
|
|
#if CONTROLLERFAN_PIN == FAN_PIN
|
|
|
|
#if defined(FAN_PIN)
|
|
|
|
#error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN"
|
|
|
|
#if CONTROLLERFAN_PIN == FAN_PIN
|
|
|
|
|
|
|
|
#error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long lastMotor = 0; //Save the time for when a motor was turned on last
|
|
|
|
unsigned long lastMotor = 0; //Save the time for when a motor was turned on last
|
|
|
@ -2124,11 +2118,11 @@ void manage_inactivity()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if KILL_PIN > 0
|
|
|
|
#if defined(KILL_PIN) && KILL_PIN > -1
|
|
|
|
if( 0 == READ(KILL_PIN) )
|
|
|
|
if( 0 == READ(KILL_PIN) )
|
|
|
|
kill();
|
|
|
|
kill();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if CONTROLLERFAN_PIN > 0
|
|
|
|
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
|
|
|
|
controllerFan(); //Check if fan should be turned on to cool stepper drivers down
|
|
|
|
controllerFan(); //Check if fan should be turned on to cool stepper drivers down
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef EXTRUDER_RUNOUT_PREVENT
|
|
|
|
#ifdef EXTRUDER_RUNOUT_PREVENT
|
|
|
@ -2165,7 +2159,9 @@ void kill()
|
|
|
|
disable_e1();
|
|
|
|
disable_e1();
|
|
|
|
disable_e2();
|
|
|
|
disable_e2();
|
|
|
|
|
|
|
|
|
|
|
|
if(PS_ON_PIN > 0) pinMode(PS_ON_PIN,INPUT);
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
|
|
|
|
pinMode(PS_ON_PIN,INPUT);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
|
|
|
|
SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
|
|
|
|
LCD_ALERTMESSAGEPGM(MSG_KILLED);
|
|
|
|
LCD_ALERTMESSAGEPGM(MSG_KILLED);
|
|
|
|