Supress compiler warning sketch/Marlin_main.cpp:3079:6: warning: unused parameter 'e_shift_late' [-Wunused-parameter]. Make function static. Fix indentation.
This commit is contained in:
parent
814d31d70d
commit
7e19b4adc1
@ -3076,106 +3076,112 @@ void gcode_M114()
|
|||||||
SERIAL_PROTOCOLLN("");
|
SERIAL_PROTOCOLLN("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void gcode_M600(bool automatic, float x_position, float y_position, float z_shift, float e_shift, float e_shift_late) {
|
static void gcode_M600(bool automatic, float x_position, float y_position, float z_shift, float e_shift, float /*e_shift_late*/)
|
||||||
st_synchronize();
|
{
|
||||||
float lastpos[4];
|
st_synchronize();
|
||||||
|
float lastpos[4];
|
||||||
|
|
||||||
if (farm_mode)
|
if (farm_mode)
|
||||||
{
|
{
|
||||||
prusa_statistics(22);
|
prusa_statistics(22);
|
||||||
}
|
}
|
||||||
|
|
||||||
//First backup current position and settings
|
//First backup current position and settings
|
||||||
feedmultiplyBckp=feedmultiply;
|
feedmultiplyBckp = feedmultiply;
|
||||||
HotendTempBckp = degTargetHotend(active_extruder);
|
HotendTempBckp = degTargetHotend(active_extruder);
|
||||||
fanSpeedBckp = fanSpeed;
|
fanSpeedBckp = fanSpeed;
|
||||||
|
|
||||||
lastpos[X_AXIS]=current_position[X_AXIS];
|
lastpos[X_AXIS] = current_position[X_AXIS];
|
||||||
lastpos[Y_AXIS]=current_position[Y_AXIS];
|
lastpos[Y_AXIS] = current_position[Y_AXIS];
|
||||||
lastpos[Z_AXIS]=current_position[Z_AXIS];
|
lastpos[Z_AXIS] = current_position[Z_AXIS];
|
||||||
lastpos[E_AXIS]=current_position[E_AXIS];
|
lastpos[E_AXIS] = current_position[E_AXIS];
|
||||||
|
|
||||||
//Retract E
|
//Retract E
|
||||||
current_position[E_AXIS]+= e_shift;
|
current_position[E_AXIS] += e_shift;
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
|
||||||
st_synchronize();
|
current_position[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
|
|
||||||
//Lift Z
|
//Lift Z
|
||||||
current_position[Z_AXIS]+= z_shift;
|
current_position[Z_AXIS] += z_shift;
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
|
||||||
st_synchronize();
|
current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
//Move XY to side
|
|
||||||
current_position[X_AXIS]= x_position;
|
|
||||||
current_position[Y_AXIS]= y_position;
|
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder);
|
|
||||||
st_synchronize();
|
|
||||||
|
|
||||||
//Beep, manage nozzle heater and wait for user to start unload filament
|
|
||||||
if(!automatic) M600_wait_for_user();
|
|
||||||
|
|
||||||
lcd_change_fil_state = 0;
|
|
||||||
|
|
||||||
// Unload filament
|
|
||||||
if (mmu_enabled)
|
|
||||||
extr_unload(); //unload just current filament for multimaterial printers (used also in M702)
|
|
||||||
else
|
|
||||||
unload_filament(); //unload filament for single material (used also in M702)
|
|
||||||
//finish moves
|
|
||||||
st_synchronize();
|
|
||||||
|
|
||||||
if (!mmu_enabled)
|
//Move XY to side
|
||||||
{
|
current_position[X_AXIS] = x_position;
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
current_position[Y_AXIS] = y_position;
|
||||||
lcd_change_fil_state = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Was filament unload successful?"), false, true);////MSG_UNLOAD_SUCCESSFUL c=20 r=2
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
|
||||||
if (lcd_change_fil_state == 0) lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=4
|
current_position[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder);
|
||||||
lcd_update_enable(true);
|
st_synchronize();
|
||||||
}
|
|
||||||
|
|
||||||
if (mmu_enabled)
|
//Beep, manage nozzle heater and wait for user to start unload filament
|
||||||
mmu_M600_load_filament(automatic);
|
if (!automatic) M600_wait_for_user();
|
||||||
else
|
|
||||||
M600_load_filament();
|
|
||||||
|
|
||||||
if(!automatic) M600_check_state();
|
lcd_change_fil_state = 0;
|
||||||
|
|
||||||
//Not let's go back to print
|
// Unload filament
|
||||||
fanSpeed = fanSpeedBckp;
|
if (mmu_enabled) extr_unload(); //unload just current filament for multimaterial printers (used also in M702)
|
||||||
|
else unload_filament(); //unload filament for single material (used also in M702)
|
||||||
|
//finish moves
|
||||||
|
st_synchronize();
|
||||||
|
|
||||||
//Feed a little of filament to stabilize pressure
|
if (!mmu_enabled)
|
||||||
if (!automatic) {
|
{
|
||||||
current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_EXFEED, active_extruder);
|
lcd_change_fil_state = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Was filament unload successful?"),
|
||||||
}
|
false, true); ////MSG_UNLOAD_SUCCESSFUL c=20 r=2
|
||||||
|
if (lcd_change_fil_state == 0)
|
||||||
//Move XY back
|
lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=4
|
||||||
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder);
|
lcd_update_enable(true);
|
||||||
st_synchronize();
|
}
|
||||||
//Move Z back
|
|
||||||
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder);
|
|
||||||
st_synchronize();
|
|
||||||
|
|
||||||
//Unretract
|
|
||||||
current_position[E_AXIS]= current_position[E_AXIS] - e_shift;
|
|
||||||
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder);
|
|
||||||
st_synchronize();
|
|
||||||
|
|
||||||
//Set E position to original
|
if (mmu_enabled) mmu_M600_load_filament(automatic);
|
||||||
plan_set_e_position(lastpos[E_AXIS]);
|
else M600_load_filament();
|
||||||
|
|
||||||
memcpy(current_position, lastpos, sizeof(lastpos));
|
if (!automatic) M600_check_state();
|
||||||
memcpy(destination, current_position, sizeof(current_position));
|
|
||||||
|
//Not let's go back to print
|
||||||
//Recover feed rate
|
fanSpeed = fanSpeedBckp;
|
||||||
feedmultiply=feedmultiplyBckp;
|
|
||||||
char cmd[9];
|
//Feed a little of filament to stabilize pressure
|
||||||
sprintf_P(cmd, PSTR("M220 S%i"), feedmultiplyBckp);
|
if (!automatic)
|
||||||
enquecommand(cmd);
|
{
|
||||||
|
current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
||||||
lcd_setstatuspgm(_T(WELCOME_MSG));
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
|
||||||
custom_message = false;
|
current_position[E_AXIS], FILAMENTCHANGE_EXFEED, active_extruder);
|
||||||
custom_message_type = 0;
|
}
|
||||||
|
|
||||||
|
//Move XY back
|
||||||
|
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS],
|
||||||
|
FILAMENTCHANGE_XYFEED, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
|
//Move Z back
|
||||||
|
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS],
|
||||||
|
FILAMENTCHANGE_ZFEED, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
|
|
||||||
|
//Unretract
|
||||||
|
current_position[E_AXIS] = current_position[E_AXIS] - e_shift;
|
||||||
|
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS],
|
||||||
|
FILAMENTCHANGE_RFEED, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
|
|
||||||
|
//Set E position to original
|
||||||
|
plan_set_e_position(lastpos[E_AXIS]);
|
||||||
|
|
||||||
|
memcpy(current_position, lastpos, sizeof(lastpos));
|
||||||
|
memcpy(destination, current_position, sizeof(current_position));
|
||||||
|
|
||||||
|
//Recover feed rate
|
||||||
|
feedmultiply = feedmultiplyBckp;
|
||||||
|
char cmd[9];
|
||||||
|
sprintf_P(cmd, PSTR("M220 S%i"), feedmultiplyBckp);
|
||||||
|
enquecommand(cmd);
|
||||||
|
|
||||||
|
lcd_setstatuspgm(_T(WELCOME_MSG));
|
||||||
|
custom_message = false;
|
||||||
|
custom_message_type = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user