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:
Marek Bel 2018-08-07 19:17:29 +02:00
parent 814d31d70d
commit 7e19b4adc1

View File

@ -3076,7 +3076,8 @@ 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(); st_synchronize();
float lastpos[4]; float lastpos[4];
@ -3097,18 +3098,21 @@ void gcode_M600(bool automatic, float x_position, float y_position, float z_shif
//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],
current_position[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder);
st_synchronize(); 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],
current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder);
st_synchronize(); st_synchronize();
//Move XY to side //Move XY to side
current_position[X_AXIS] = x_position; current_position[X_AXIS] = x_position;
current_position[Y_AXIS] = y_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); 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(); st_synchronize();
//Beep, manage nozzle heater and wait for user to start unload filament //Beep, manage nozzle heater and wait for user to start unload filament
@ -3117,25 +3121,23 @@ void gcode_M600(bool automatic, float x_position, float y_position, float z_shif
lcd_change_fil_state = 0; lcd_change_fil_state = 0;
// Unload filament // Unload filament
if (mmu_enabled) if (mmu_enabled) extr_unload(); //unload just current filament for multimaterial printers (used also in M702)
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)
else
unload_filament(); //unload filament for single material (used also in M702)
//finish moves //finish moves
st_synchronize(); st_synchronize();
if (!mmu_enabled) if (!mmu_enabled)
{ {
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
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 lcd_change_fil_state = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Was filament unload successful?"),
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 false, true); ////MSG_UNLOAD_SUCCESSFUL c=20 r=2
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
lcd_update_enable(true); lcd_update_enable(true);
} }
if (mmu_enabled) if (mmu_enabled) mmu_M600_load_filament(automatic);
mmu_M600_load_filament(automatic); else M600_load_filament();
else
M600_load_filament();
if (!automatic) M600_check_state(); if (!automatic) M600_check_state();
@ -3143,21 +3145,26 @@ void gcode_M600(bool automatic, float x_position, float y_position, float z_shif
fanSpeed = fanSpeedBckp; fanSpeed = fanSpeedBckp;
//Feed a little of filament to stabilize pressure //Feed a little of filament to stabilize pressure
if (!automatic) { if (!automatic)
{
current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_EXFEED, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
current_position[E_AXIS], FILAMENTCHANGE_EXFEED, active_extruder);
} }
//Move XY back //Move XY back
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder); plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS],
FILAMENTCHANGE_XYFEED, active_extruder);
st_synchronize(); st_synchronize();
//Move Z back //Move Z back
plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder); plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS],
FILAMENTCHANGE_ZFEED, active_extruder);
st_synchronize(); st_synchronize();
//Unretract //Unretract
current_position[E_AXIS] = current_position[E_AXIS] - e_shift; 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); plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS],
FILAMENTCHANGE_RFEED, active_extruder);
st_synchronize(); st_synchronize();
//Set E position to original //Set E position to original
@ -3175,7 +3182,6 @@ void gcode_M600(bool automatic, float x_position, float y_position, float z_shif
lcd_setstatuspgm(_T(WELCOME_MSG)); lcd_setstatuspgm(_T(WELCOME_MSG));
custom_message = false; custom_message = false;
custom_message_type = 0; custom_message_type = 0;
} }