Commentary / style in gcode_M600

master
Scott Lahteine 8 years ago
parent 561904345f
commit 44b4e116bd

@ -7350,10 +7350,11 @@ inline void gcode_M503() {
#endif #endif
// 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); destination[E_AXIS] += code_seen('E') ? code_value_axis_units(E_AXIS) : 0
#if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0 #if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0
else destination[E_AXIS] -= FILAMENT_CHANGE_RETRACT_LENGTH; - (FILAMENT_CHANGE_RETRACT_LENGTH)
#endif #endif
;
RUNPLAN(FILAMENT_CHANGE_RETRACT_FEEDRATE); RUNPLAN(FILAMENT_CHANGE_RETRACT_FEEDRATE);
@ -7390,10 +7391,11 @@ inline void gcode_M503() {
idle(); idle();
// Unload filament // Unload filament
if (code_seen('L')) destination[E_AXIS] += code_value_axis_units(E_AXIS); destination[E_AXIS] += code_seen('L') ? code_value_axis_units(E_AXIS) : 0
#if defined(FILAMENT_CHANGE_UNLOAD_LENGTH) && FILAMENT_CHANGE_UNLOAD_LENGTH > 0 #if FILAMENT_CHANGE_UNLOAD_LENGTH > 0
else destination[E_AXIS] -= FILAMENT_CHANGE_UNLOAD_LENGTH; - (FILAMENT_CHANGE_UNLOAD_LENGTH)
#endif #endif
;
RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE); RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
@ -7474,29 +7476,39 @@ inline void gcode_M503() {
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD); lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD);
// Load filament // Load filament
if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS); destination[E_AXIS] += code_seen('L') ? -code_value_axis_units(E_AXIS) : 0
#if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0 #if FILAMENT_CHANGE_LOAD_LENGTH > 0
else destination[E_AXIS] += FILAMENT_CHANGE_LOAD_LENGTH; + FILAMENT_CHANGE_LOAD_LENGTH
#endif #endif
;
RUNPLAN(FILAMENT_CHANGE_LOAD_FEEDRATE); RUNPLAN(FILAMENT_CHANGE_LOAD_FEEDRATE);
stepper.synchronize(); stepper.synchronize();
#if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0 #if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0
do { do {
// Extrude filament to get into hotend // "Wait for filament extrude"
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE); lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE);
// Extrude filament to get into hotend
destination[E_AXIS] += FILAMENT_CHANGE_EXTRUDE_LENGTH; destination[E_AXIS] += FILAMENT_CHANGE_EXTRUDE_LENGTH;
RUNPLAN(FILAMENT_CHANGE_EXTRUDE_FEEDRATE); RUNPLAN(FILAMENT_CHANGE_EXTRUDE_FEEDRATE);
stepper.synchronize(); stepper.synchronize();
// Ask user if more filament should be extruded
// Show "Extrude More" / "Resume" menu and wait for reply
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false;
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_OPTION); lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_OPTION);
while (filament_change_menu_response == FILAMENT_CHANGE_RESPONSE_WAIT_FOR) idle(true); while (filament_change_menu_response == FILAMENT_CHANGE_RESPONSE_WAIT_FOR) idle(true);
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
} while (filament_change_menu_response != FILAMENT_CHANGE_RESPONSE_RESUME_PRINT);
// Keep looping if "Extrude More" was selected
} while (filament_change_menu_response == FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE);
#endif #endif
// "Wait for print to resume"
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME); lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME);
// Set extruder to saved position // Set extruder to saved position

Loading…
Cancel
Save