|
|
@ -7310,7 +7310,7 @@ inline void gcode_M503() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool busy_doing_M600 = false;
|
|
|
|
static bool busy_doing_M600 = false;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* M600: Pause for filament change
|
|
|
|
* M600: Pause for filament change
|
|
|
@ -7351,8 +7351,6 @@ inline void gcode_M503() {
|
|
|
|
#define RUNPLAN(RATE_MM_S) line_to_destination(RATE_MM_S);
|
|
|
|
#define RUNPLAN(RATE_MM_S) line_to_destination(RATE_MM_S);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Initial retract before move to filament change position
|
|
|
|
// Initial retract before move to filament change position
|
|
|
|
if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS);
|
|
|
|
if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS);
|
|
|
|
#if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0
|
|
|
|
#if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0
|
|
|
@ -7412,7 +7410,6 @@ inline void gcode_M503() {
|
|
|
|
millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT * 1000L;
|
|
|
|
millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT * 1000L;
|
|
|
|
bool nozzle_timed_out = false;
|
|
|
|
bool nozzle_timed_out = false;
|
|
|
|
float temps[4];
|
|
|
|
float temps[4];
|
|
|
|
int iii;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Wait for filament insert by user and press button
|
|
|
|
// Wait for filament insert by user and press button
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
|
@ -7422,62 +7419,62 @@ inline void gcode_M503() {
|
|
|
|
wait_for_user = true; // LCD click or M108 will clear this
|
|
|
|
wait_for_user = true; // LCD click or M108 will clear this
|
|
|
|
next_buzz = 0;
|
|
|
|
next_buzz = 0;
|
|
|
|
runout_beep = 0;
|
|
|
|
runout_beep = 0;
|
|
|
|
for( iii=0; iii<HOTENDS; iii++) //Save nozzle temps
|
|
|
|
HOTEND_LOOP() temps[e] = thermalManager.target_temperature[e]; // Save nozzle temps
|
|
|
|
temps[iii] = thermalManager.target_temperature[iii];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (wait_for_user) {
|
|
|
|
while (wait_for_user) {
|
|
|
|
millis_t current_ms = millis();
|
|
|
|
millis_t current_ms = millis();
|
|
|
|
if (nozzle_timed_out == true)
|
|
|
|
if (nozzle_timed_out)
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BUZZER
|
|
|
|
#if HAS_BUZZER
|
|
|
|
filament_change_beep();
|
|
|
|
filament_change_beep();
|
|
|
|
#endif //HAS_BUZZER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (current_ms >= nozzle_timeout) {
|
|
|
|
if (current_ms >= nozzle_timeout) {
|
|
|
|
if (nozzle_timed_out == false ) {
|
|
|
|
if (!nozzle_timed_out) {
|
|
|
|
nozzle_timed_out = true; // if the nozzle time out happens, remember we turned off the nozzles.
|
|
|
|
nozzle_timed_out = true; // on nozzle timeout remember the nozzles need to be reheated
|
|
|
|
for( iii=0; iii<HOTENDS; iii++) // turn off all the nozzles
|
|
|
|
HOTEND_LOOP() thermalManager.setTargetHotend(0, e); // Turn off all the nozzles
|
|
|
|
thermalManager.setTargetHotend( 0.0 , iii );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
idle(true);
|
|
|
|
idle(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (nozzle_timed_out == true ) { // Turn nozzles back on if we turned them off.
|
|
|
|
if (nozzle_timed_out) // Turn nozzles back on if they were turned off
|
|
|
|
for( iii=0; iii<HOTENDS; iii++)
|
|
|
|
HOTEND_LOOP() thermalManager.setTargetHotend(temps[e], e);
|
|
|
|
thermalManager.setTargetHotend( temps[iii] , iii );
|
|
|
|
|
|
|
|
|
|
|
|
// Show "wait for heating"
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KEEP_CHECKING_TEMPS:
|
|
|
|
wait_for_heatup = true;
|
|
|
|
|
|
|
|
while (wait_for_heatup) {
|
|
|
|
idle();
|
|
|
|
idle();
|
|
|
|
for( iii=0; iii<HOTENDS; iii++){
|
|
|
|
wait_for_heatup = false;
|
|
|
|
if (abs(thermalManager.degHotend(iii)-temps[iii]) > 3 ) {
|
|
|
|
HOTEND_LOOP() {
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
|
|
|
|
if (abs(thermalManager.degHotend(e) - temps[e]) > 3) {
|
|
|
|
goto KEEP_CHECKING_TEMPS;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Show "insert filament"
|
|
|
|
|
|
|
|
if (nozzle_timed_out)
|
|
|
|
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
|
|
|
|
|
|
|
|
|
|
wait_for_user = true; // LCD click or M108 will clear this
|
|
|
|
wait_for_user = true; // LCD click or M108 will clear this
|
|
|
|
next_buzz = 0;
|
|
|
|
next_buzz = 0;
|
|
|
|
runout_beep = 0;
|
|
|
|
runout_beep = 0;
|
|
|
|
while (wait_for_user) {
|
|
|
|
while (wait_for_user && nozzle_timed_out) {
|
|
|
|
if (nozzle_timed_out == true)
|
|
|
|
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
|
|
|
|
|
|
else break;
|
|
|
|
|
|
|
|
#if HAS_BUZZER
|
|
|
|
#if HAS_BUZZER
|
|
|
|
filament_change_beep();
|
|
|
|
filament_change_beep();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
idle(true);
|
|
|
|
idle(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Show load message
|
|
|
|
// Show "load" message
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD);
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD);
|
|
|
|
|
|
|
|
|
|
|
|
idle();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load filament
|
|
|
|
// Load filament
|
|
|
|
if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS);
|
|
|
|
if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS);
|
|
|
|
#if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0
|
|
|
|
#if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0
|
|
|
@ -7504,8 +7501,6 @@ KEEP_CHECKING_TEMPS:
|
|
|
|
|
|
|
|
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME);
|
|
|
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME);
|
|
|
|
|
|
|
|
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set extruder to saved position
|
|
|
|
// Set extruder to saved position
|
|
|
|
destination[E_AXIS] = current_position[E_AXIS] = lastpos[E_AXIS];
|
|
|
|
destination[E_AXIS] = current_position[E_AXIS] = lastpos[E_AXIS];
|
|
|
|
planner.set_e_position_mm(current_position[E_AXIS]);
|
|
|
|
planner.set_e_position_mm(current_position[E_AXIS]);
|
|
|
@ -10145,13 +10140,14 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
|
|
|
|
|
|
|
|
|
|
|
if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED));
|
|
|
|
if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED));
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
|
|
|
// Prevent steppers timing-out in the middle of M600
|
|
|
|
#ifdef STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE
|
|
|
|
#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
|
|
|
|
if (busy_doing_M600 == false ) // We only allow the stepper motors to time out if
|
|
|
|
#define M600_TEST !busy_doing_M600
|
|
|
|
#endif // we are not in the middle of an M600 command.
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define M600_TEST true
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
|
|
|
|
if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
|
|
|
|
&& !ignore_stepper_queue && !planner.blocks_queued()) {
|
|
|
|
&& !ignore_stepper_queue && !planner.blocks_queued()) {
|
|
|
|
#if ENABLED(DISABLE_INACTIVE_X)
|
|
|
|
#if ENABLED(DISABLE_INACTIVE_X)
|
|
|
|
disable_x();
|
|
|
|
disable_x();
|
|
|
|