|
|
@ -154,6 +154,8 @@
|
|
|
|
// M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
|
|
|
|
// M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
|
|
|
|
// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
|
|
|
// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
|
|
|
// M304 - Set bed PID parameters P I and D
|
|
|
|
// M304 - Set bed PID parameters P I and D
|
|
|
|
|
|
|
|
// M380 - Activate solenoid on active extruder
|
|
|
|
|
|
|
|
// M381 - Disable all solenoids
|
|
|
|
// M400 - Finish all moves
|
|
|
|
// M400 - Finish all moves
|
|
|
|
// M401 - Lower z-probe if present
|
|
|
|
// M401 - Lower z-probe if present
|
|
|
|
// M402 - Raise z-probe if present
|
|
|
|
// M402 - Raise z-probe if present
|
|
|
@ -529,32 +531,28 @@ void setup_homepin(void)
|
|
|
|
void setup_photpin()
|
|
|
|
void setup_photpin()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
|
|
|
|
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
|
|
|
|
SET_OUTPUT(PHOTOGRAPH_PIN);
|
|
|
|
OUT_WRITE(PHOTOGRAPH_PIN, LOW);
|
|
|
|
WRITE(PHOTOGRAPH_PIN, LOW);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setup_powerhold()
|
|
|
|
void setup_powerhold()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
OUT_WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
#if defined(PS_DEFAULT_OFF)
|
|
|
|
#if defined(PS_DEFAULT_OFF)
|
|
|
|
OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void suicide()
|
|
|
|
void suicide()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
OUT_WRITE(SUICIDE_PIN, LOW);
|
|
|
|
WRITE(SUICIDE_PIN, LOW);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2723,15 +2721,13 @@ Sigma_Exit:
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
case 80: // M80 - Turn on Power Supply
|
|
|
|
case 80: // M80 - Turn on Power Supply
|
|
|
|
SET_OUTPUT(PS_ON_PIN); //GND
|
|
|
|
OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); // GND
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If you have a switch on suicide pin, this is useful
|
|
|
|
// If you have a switch on suicide pin, this is useful
|
|
|
|
// if you want to start another print with suicide feature after
|
|
|
|
// if you want to start another print with suicide feature after
|
|
|
|
// a print without suicide...
|
|
|
|
// a print without suicide...
|
|
|
|
#if defined SUICIDE_PIN && SUICIDE_PIN > -1
|
|
|
|
#if defined SUICIDE_PIN && SUICIDE_PIN > -1
|
|
|
|
SET_OUTPUT(SUICIDE_PIN);
|
|
|
|
OUT_WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
WRITE(SUICIDE_PIN, HIGH);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ULTIPANEL
|
|
|
|
#ifdef ULTIPANEL
|
|
|
@ -2755,8 +2751,7 @@ Sigma_Exit:
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
|
suicide();
|
|
|
|
suicide();
|
|
|
|
#elif defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
#elif defined(PS_ON_PIN) && PS_ON_PIN > -1
|
|
|
|
SET_OUTPUT(PS_ON_PIN);
|
|
|
|
OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
|
|
WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef ULTIPANEL
|
|
|
|
#ifdef ULTIPANEL
|
|
|
|
powersupply = false;
|
|
|
|
powersupply = false;
|
|
|
@ -3118,7 +3113,7 @@ Sigma_Exit:
|
|
|
|
SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
|
|
|
|
SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SERIAL_ECHOLN("");
|
|
|
|
SERIAL_EOL;
|
|
|
|
}break;
|
|
|
|
}break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
case 220: // M220 S<factor in percent>- set speed factor override percentage
|
|
|
|
case 220: // M220 S<factor in percent>- set speed factor override percentage
|
|
|
@ -3337,8 +3332,7 @@ Sigma_Exit:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef CHDK
|
|
|
|
#ifdef CHDK
|
|
|
|
|
|
|
|
|
|
|
|
SET_OUTPUT(CHDK);
|
|
|
|
OUT_WRITE(CHDK, HIGH);
|
|
|
|
WRITE(CHDK, HIGH);
|
|
|
|
|
|
|
|
chdkHigh = millis();
|
|
|
|
chdkHigh = millis();
|
|
|
|
chdkActive = true;
|
|
|
|
chdkActive = true;
|
|
|
|
|
|
|
|
|
|
|
@ -3497,6 +3491,17 @@ Sigma_Exit:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef EXT_SOLENOID
|
|
|
|
|
|
|
|
case 380:
|
|
|
|
|
|
|
|
enable_solenoid_on_active_extruder();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 381:
|
|
|
|
|
|
|
|
disable_all_solenoids();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif //EXT_SOLENOID
|
|
|
|
|
|
|
|
|
|
|
|
case 400: // M400 finish all moves
|
|
|
|
case 400: // M400 finish all moves
|
|
|
|
{
|
|
|
|
{
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
@ -3737,9 +3742,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
|
|
|
if(cnt==0)
|
|
|
|
if(cnt==0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if BEEPER > 0
|
|
|
|
#if BEEPER > 0
|
|
|
|
SET_OUTPUT(BEEPER);
|
|
|
|
OUT_WRITE(BEEPER,HIGH);
|
|
|
|
|
|
|
|
|
|
|
|
WRITE(BEEPER,HIGH);
|
|
|
|
|
|
|
|
delay(3);
|
|
|
|
delay(3);
|
|
|
|
WRITE(BEEPER,LOW);
|
|
|
|
WRITE(BEEPER,LOW);
|
|
|
|
delay(3);
|
|
|
|
delay(3);
|
|
|
@ -4000,6 +4003,13 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
|
|
|
prepare_move();
|
|
|
|
prepare_move();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef EXT_SOLENOID
|
|
|
|
|
|
|
|
st_synchronize();
|
|
|
|
|
|
|
|
disable_all_solenoids();
|
|
|
|
|
|
|
|
enable_solenoid_on_active_extruder();
|
|
|
|
|
|
|
|
#endif //EXT_SOLENOID
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
SERIAL_ECHO_START;
|
|
|
|
SERIAL_ECHO_START;
|
|
|
|
SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
|
|
|
|
SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
|
|
|
@ -4707,7 +4717,6 @@ bool setTargetedHotend(int code){
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float calculate_volumetric_multiplier(float diameter) {
|
|
|
|
float calculate_volumetric_multiplier(float diameter) {
|
|
|
|
if (!volumetric_enabled || diameter == 0) return 1.0;
|
|
|
|
if (!volumetric_enabled || diameter == 0) return 1.0;
|
|
|
|
float d2 = diameter * 0.5;
|
|
|
|
float d2 = diameter * 0.5;
|
|
|
@ -4718,3 +4727,43 @@ void calculate_volumetric_multipliers() {
|
|
|
|
for (int i=0; i<EXTRUDERS; i++)
|
|
|
|
for (int i=0; i<EXTRUDERS; i++)
|
|
|
|
volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
|
|
|
|
volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef EXT_SOLENOID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void enable_solenoid(uint8_t num) {
|
|
|
|
|
|
|
|
switch(num) {
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
OUT_WRITE(SOL0_PIN, HIGH);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if defined(SOL1_PIN) && SOL1_PIN > -1
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
OUT_WRITE(SOL1_PIN, HIGH);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(SOL2_PIN) && SOL2_PIN > -1
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
OUT_WRITE(SOL2_PIN, HIGH);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(SOL3_PIN) && SOL3_PIN > -1
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
OUT_WRITE(SOL3_PIN, HIGH);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
SERIAL_ECHO_START;
|
|
|
|
|
|
|
|
SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void enable_solenoid_on_active_extruder() { enable_solenoid(active_extruder); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void disable_all_solenoids() {
|
|
|
|
|
|
|
|
OUT_WRITE(SOL0_PIN, LOW);
|
|
|
|
|
|
|
|
OUT_WRITE(SOL1_PIN, LOW);
|
|
|
|
|
|
|
|
OUT_WRITE(SOL2_PIN, LOW);
|
|
|
|
|
|
|
|
OUT_WRITE(SOL3_PIN, LOW);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif //EXT_SOLENOID
|
|
|
|