|
|
@ -40,11 +40,11 @@
|
|
|
|
#include "language.h"
|
|
|
|
#include "language.h"
|
|
|
|
#include "pins_arduino.h"
|
|
|
|
#include "pins_arduino.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if (defined NUM_SERVOS) && (NUM_SERVOS > 0)
|
|
|
|
#if NUM_SERVOS > 0
|
|
|
|
#include "Servo.h"
|
|
|
|
#include "Servo.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if DIGIPOTSS_PIN > -1
|
|
|
|
#if DIGIPOTSS_PIN > 0
|
|
|
|
#include <SPI.h>
|
|
|
|
#include <SPI.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -230,7 +230,7 @@ static uint8_t tmp_extruder;
|
|
|
|
|
|
|
|
|
|
|
|
bool Stopped=false;
|
|
|
|
bool Stopped=false;
|
|
|
|
|
|
|
|
|
|
|
|
#if (defined NUM_SERVOS) && (NUM_SERVOS > 0)
|
|
|
|
#if NUM_SERVOS > 0
|
|
|
|
Servo servos[NUM_SERVOS];
|
|
|
|
Servo servos[NUM_SERVOS];
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -309,7 +309,7 @@ void setup_killpin()
|
|
|
|
void setup_photpin()
|
|
|
|
void setup_photpin()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef PHOTOGRAPH_PIN
|
|
|
|
#ifdef PHOTOGRAPH_PIN
|
|
|
|
#if (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
|
|
|
@ -324,7 +324,7 @@ void setup_powerhold()
|
|
|
|
WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (PS_ON_PIN > -1)
|
|
|
|
#if (PS_ON_PIN > 0)
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -333,7 +333,7 @@ void setup_powerhold()
|
|
|
|
void suicide()
|
|
|
|
void suicide()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef SUICIDE_PIN
|
|
|
|
#ifdef SUICIDE_PIN
|
|
|
|
#if (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
|
|
|
@ -342,16 +342,16 @@ void suicide()
|
|
|
|
|
|
|
|
|
|
|
|
void servo_init()
|
|
|
|
void servo_init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if (NUM_SERVOS >= 1) && defined (SERVO0_PIN) && (SERVO0_PIN > -1)
|
|
|
|
#if (NUM_SERVOS >= 1) && (SERVO0_PIN > 0)
|
|
|
|
servos[0].attach(SERVO0_PIN);
|
|
|
|
servos[0].attach(SERVO0_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 2) && defined (SERVO1_PIN) && (SERVO1_PIN > -1)
|
|
|
|
#if (NUM_SERVOS >= 2) && (SERVO1_PIN > 0)
|
|
|
|
servos[1].attach(SERVO1_PIN);
|
|
|
|
servos[1].attach(SERVO1_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 3) && defined (SERVO2_PIN) && (SERVO2_PIN > -1)
|
|
|
|
#if (NUM_SERVOS >= 3) && (SERVO2_PIN > 0)
|
|
|
|
servos[2].attach(SERVO2_PIN);
|
|
|
|
servos[2].attach(SERVO2_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 4) && defined (SERVO3_PIN) && (SERVO3_PIN > -1)
|
|
|
|
#if (NUM_SERVOS >= 4) && (SERVO3_PIN > 0)
|
|
|
|
servos[3].attach(SERVO3_PIN);
|
|
|
|
servos[3].attach(SERVO3_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if (NUM_SERVOS >= 5)
|
|
|
|
#if (NUM_SERVOS >= 5)
|
|
|
@ -673,7 +673,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 > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
|
|
|
|
((LETTER##_MIN_PIN > 0 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > 0 && 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) :
|
|
|
@ -911,13 +911,13 @@ void process_commands()
|
|
|
|
previous_millis_cmd = millis();
|
|
|
|
previous_millis_cmd = millis();
|
|
|
|
if (codenum > 0){
|
|
|
|
if (codenum > 0){
|
|
|
|
codenum += millis(); // keep track of when we started waiting
|
|
|
|
codenum += millis(); // keep track of when we started waiting
|
|
|
|
while(millis() < codenum && !LCD_CLICKED){
|
|
|
|
while(millis() < codenum && !lcd_clicked()){
|
|
|
|
manage_heater();
|
|
|
|
manage_heater();
|
|
|
|
manage_inactivity();
|
|
|
|
manage_inactivity();
|
|
|
|
lcd_update();
|
|
|
|
lcd_update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
while(!LCD_CLICKED){
|
|
|
|
while(!lcd_clicked()){
|
|
|
|
manage_heater();
|
|
|
|
manage_heater();
|
|
|
|
manage_inactivity();
|
|
|
|
manage_inactivity();
|
|
|
|
lcd_update();
|
|
|
|
lcd_update();
|
|
|
@ -1062,12 +1062,12 @@ void process_commands()
|
|
|
|
if(setTargetedHotend(105)){
|
|
|
|
if(setTargetedHotend(105)){
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if (TEMP_0_PIN > -1)
|
|
|
|
#if (TEMP_0_PIN > 0)
|
|
|
|
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 > -1
|
|
|
|
#if TEMP_BED_PIN > 0
|
|
|
|
SERIAL_PROTOCOLPGM(" B:");
|
|
|
|
SERIAL_PROTOCOLPGM(" B:");
|
|
|
|
SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
|
SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
|
SERIAL_PROTOCOLPGM(" /");
|
|
|
|
SERIAL_PROTOCOLPGM(" /");
|
|
|
@ -1165,7 +1165,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 > -1
|
|
|
|
#if TEMP_BED_PIN > 0
|
|
|
|
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 +1192,7 @@ void process_commands()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
#if FAN_PIN > -1
|
|
|
|
#if FAN_PIN > 0
|
|
|
|
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 +1207,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 > -1
|
|
|
|
#if HEATER_1_PIN > 0
|
|
|
|
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 +1222,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 > -1
|
|
|
|
#if HEATER_2_PIN > 0
|
|
|
|
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 +1237,7 @@ void process_commands()
|
|
|
|
#endif //HEATER_2_PIN
|
|
|
|
#endif //HEATER_2_PIN
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if (PS_ON_PIN > -1)
|
|
|
|
#if (PS_ON_PIN > 0)
|
|
|
|
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 +1246,10 @@ void process_commands()
|
|
|
|
|
|
|
|
|
|
|
|
case 81: // M81 - ATX Power Off
|
|
|
|
case 81: // M81 - ATX Power Off
|
|
|
|
|
|
|
|
|
|
|
|
#if defined SUICIDE_PIN && SUICIDE_PIN > -1
|
|
|
|
#if defined SUICIDE_PIN && SUICIDE_PIN > 0
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
|
suicide();
|
|
|
|
suicide();
|
|
|
|
#elif (PS_ON_PIN > -1)
|
|
|
|
#elif (PS_ON_PIN > 0)
|
|
|
|
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 +1354,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 > -1)
|
|
|
|
#if (X_MIN_PIN > 0)
|
|
|
|
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 > -1)
|
|
|
|
#if (X_MAX_PIN > 0)
|
|
|
|
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 > -1)
|
|
|
|
#if (Y_MIN_PIN > 0)
|
|
|
|
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 > -1)
|
|
|
|
#if (Y_MAX_PIN > 0)
|
|
|
|
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 > -1)
|
|
|
|
#if (Z_MIN_PIN > 0)
|
|
|
|
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 > -1)
|
|
|
|
#if (Z_MAX_PIN > 0)
|
|
|
|
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
|
|
|
@ -1514,7 +1514,7 @@ void process_commands()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
#if (defined NUM_SERVOS) && (NUM_SERVOS > 0)
|
|
|
|
#if NUM_SERVOS > 0
|
|
|
|
case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds
|
|
|
|
case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int servo_index = -1;
|
|
|
|
int servo_index = -1;
|
|
|
@ -1545,16 +1545,20 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif // NUM_SERVOS > 0
|
|
|
|
#endif // NUM_SERVOS > 0
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1
|
|
|
|
#if LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) )
|
|
|
|
case 300: // M300
|
|
|
|
case 300: // M300
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int beepS = 1;
|
|
|
|
int beepS = 400;
|
|
|
|
int beepP = 1000;
|
|
|
|
int beepP = 1000;
|
|
|
|
if(code_seen('S')) beepS = code_value();
|
|
|
|
if(code_seen('S')) beepS = code_value();
|
|
|
|
if(code_seen('P')) beepP = code_value();
|
|
|
|
if(code_seen('P')) beepP = code_value();
|
|
|
|
|
|
|
|
#if BEEPER > 0
|
|
|
|
tone(BEEPER, beepS);
|
|
|
|
tone(BEEPER, beepS);
|
|
|
|
delay(beepP);
|
|
|
|
delay(beepP);
|
|
|
|
noTone(BEEPER);
|
|
|
|
noTone(BEEPER);
|
|
|
|
|
|
|
|
#elif defined(ULTRALCD)
|
|
|
|
|
|
|
|
lcd_buzz(beepS, beepP);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif // M300
|
|
|
|
#endif // M300
|
|
|
@ -1609,7 +1613,7 @@ void process_commands()
|
|
|
|
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
|
|
|
|
#ifdef PHOTOGRAPH_PIN
|
|
|
|
#if (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++) {
|
|
|
@ -1765,24 +1769,25 @@ void process_commands()
|
|
|
|
delay(100);
|
|
|
|
delay(100);
|
|
|
|
LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
|
|
|
|
LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
|
|
|
|
uint8_t cnt=0;
|
|
|
|
uint8_t cnt=0;
|
|
|
|
while(!LCD_CLICKED){
|
|
|
|
while(!lcd_clicked()){
|
|
|
|
cnt++;
|
|
|
|
cnt++;
|
|
|
|
manage_heater();
|
|
|
|
manage_heater();
|
|
|
|
manage_inactivity();
|
|
|
|
manage_inactivity();
|
|
|
|
lcd_update();
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
|
|
|
|
#if BEEPER > -1
|
|
|
|
|
|
|
|
if(cnt==0)
|
|
|
|
if(cnt==0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#if BEEPER > 0
|
|
|
|
SET_OUTPUT(BEEPER);
|
|
|
|
SET_OUTPUT(BEEPER);
|
|
|
|
|
|
|
|
|
|
|
|
WRITE(BEEPER,HIGH);
|
|
|
|
WRITE(BEEPER,HIGH);
|
|
|
|
delay(3);
|
|
|
|
delay(3);
|
|
|
|
WRITE(BEEPER,LOW);
|
|
|
|
WRITE(BEEPER,LOW);
|
|
|
|
delay(3);
|
|
|
|
delay(3);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
|
|
|
|
lcd_buzz(1000/6,100);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//return to normal
|
|
|
|
//return to normal
|
|
|
|
if(code_seen('L'))
|
|
|
|
if(code_seen('L'))
|
|
|
@ -1806,7 +1811,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 > -1
|
|
|
|
#if DIGIPOTSS_PIN > 0
|
|
|
|
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());
|
|
|
@ -1815,7 +1820,7 @@ void process_commands()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 908: // M908 Control digital trimpot directly.
|
|
|
|
case 908: // M908 Control digital trimpot directly.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if DIGIPOTSS_PIN > -1
|
|
|
|
#if DIGIPOTSS_PIN > 0
|
|
|
|
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();
|
|
|
@ -1825,7 +1830,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 > -1
|
|
|
|
#if X_MS1_PIN > 0
|
|
|
|
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());
|
|
|
@ -1835,7 +1840,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 > -1
|
|
|
|
#if X_MS1_PIN > 0
|
|
|
|
if(code_seen('S')) switch((int)code_value())
|
|
|
|
if(code_seen('S')) switch((int)code_value())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
@ -2173,7 +2178,7 @@ void kill()
|
|
|
|
disable_e1();
|
|
|
|
disable_e1();
|
|
|
|
disable_e2();
|
|
|
|
disable_e2();
|
|
|
|
|
|
|
|
|
|
|
|
if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
|
|
|
|
if(PS_ON_PIN > 0) pinMode(PS_ON_PIN,INPUT);
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
|
|
|
|
SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
|
|
|
|
LCD_ALERTMESSAGEPGM(MSG_KILLED);
|
|
|
|
LCD_ALERTMESSAGEPGM(MSG_KILLED);
|
|
|
|