diff --git a/.travis.yml b/.travis.yml index fecb82a8d1ef..34dc19ccd80f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -162,10 +162,10 @@ script: - opt_enable LCM1602 - build_marlin # - # Enable FILAMENTCHANGEENABLE + # Enable FILAMENTCHANGEENABLE and MANUAL_FILAMENT_CHANGE # - restore_configs - - opt_enable FILAMENTCHANGEENABLE ULTIMAKERCONTROLLER + - opt_enable FILAMENTCHANGEENABLE MANUAL_FILAMENT_CHANGE ULTIMAKERCONTROLLER - build_marlin # # Enable filament sensor diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3947e425fbfc..77f30a031a81 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -518,14 +518,22 @@ const unsigned int dropsegments = 5; //everything with less than this number of #if ENABLED(ULTIPANEL) //#define FILAMENTCHANGEENABLE #if ENABLED(FILAMENTCHANGEENABLE) + #define MANUAL_FILAMENT_CHANGE //Add Filament Change to the LCD Menus #define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_ZADD 10 #define FILAMENTCHANGE_FIRSTRETRACT -2 #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD + #define AUTO_FILAMENT_CHANGE //Extrude filament until you press the button on LCD #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + + #if ENABLED(MANUAL_FILAMENT_CHANGE) + #define FILAMENT_LOAD_LENGTH 55 + #define FILAMENT_CHANGE_NORMAL_SPEED 100 + #define FILAMENT_CHANGE_SLOW_SPEED 3.5 + #endif + #endif #endif diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 1209c667ba2a..d124adacefe4 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1060,7 +1060,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index b9201e5b3524..f8736898d716 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1069,7 +1069,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 6217383a8fa7..79df6bd39587 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1071,7 +1071,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index ddd3edd2a117..7b32d0fcaf38 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1094,7 +1094,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 8010cd7e6a64..28c93497ccfb 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1071,7 +1071,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index c9dada3651b2..94c8fbe8e69a 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1074,7 +1074,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 2acd5f337686..3adf8205b99c 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1085,7 +1085,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 0a6e093b6573..63f8ee1f29df 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1098,7 +1098,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 81db59816724..41b3b87e8021 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1069,7 +1069,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index c7d69f79fe0e..acfc25bd0ef1 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1077,7 +1077,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 0c77a11775d8..df382b880852 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1206,7 +1206,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 6e76916364a9..32bed6128b45 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1206,7 +1206,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index c04781810fe7..605e3c328199 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1210,7 +1210,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index c8093b161b17..163a619deaa0 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1203,7 +1203,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 73e49c7e5cd4..f1dc5e52616c 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1211,7 +1211,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 416765b258f5..7a7f8f1f5554 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1080,7 +1080,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 65fd6aacc59b..c9ba3143fbd7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1071,7 +1071,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //define BlinkM/CyzRgb Support //#define BLINKM - +/* + * Define the size of the full retract and insert filament. The feed rate for the complete insertion/retract and the feedrate for the slow inserction +*/ +#define FILAMENTCOMPLETCHANGE_SIZE 75 +#define FILAMENTCOMPLETCHANGE_FAST_FEEDRATE 100 +#define FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE 1.5 /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 8ffbb50ed49f..a9bc6bb9ca5a 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -508,5 +508,23 @@ #ifndef MSG_DELTA_CALIBRATE_CENTER #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #endif +#ifndef MSG_CHANGE_FILAMENT + #define MSG_CHANGE_FILAMENT "Filament" +#endif +#ifndef MSG_EJECT_FILAMENT + #define MSG_EJECT_FILAMENT "Eject" +#endif +#ifndef MSG_INSERT_FILAMENT + #define MSG_INSERT_FILAMENT "Insert" +#endif +#ifndef MSG_INSERT_FILAMENT_SLOW + #define MSG_INSERT_FILAMENT_SLOW "Slow Insert" +#endif +#ifndef MSG_STOP_EJECT + #define MSG_STOP_EJECT "Stop " MSG_EJECT_FILAMENT +#endif +#ifndef MSG_STOP_INSERT + #define MSG_STOP_INSERT "Stop " MSG_INSERT_FILAMENT +#endif #endif // LANGUAGE_EN_H diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index f75f0330ad7f..7b0bfea7d04c 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -170,4 +170,9 @@ #define MSG_DELTA_CALIBRATE_Z "Calibrar Z" #define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro" +#define MSG_CHANGE_FILAMENT "Filamento" +#define MSG_EJECT_FILAMENT "Retirar" +#define MSG_INSERT_FILAMENT "Inserir" +#define MSG_INSERT_FILAMENT_SLOW "Lentamente" + #endif // LANGUAGE_PT_BR_H diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a524d15f8753..e99adeed6290 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -61,6 +61,12 @@ int absPreheatHotendTemp; int absPreheatHPBTemp; int absPreheatFanSpeed; +#if ENABLED(MANUAL_FILAMENT_CHANGE) + enum MFCState { MFC_IDLE, MFC_EJECTING, MFC_INSERTING, MFC_INSERTING_SLOW }; + MFCState mfc_state = MFC_IDLE; + bool mfc_filament_slow_inserting; +#endif + #if ENABLED(FILAMENT_LCD_DISPLAY) millis_t previous_lcd_status_ms = 0; #endif @@ -96,7 +102,8 @@ static void lcd_status_screen(); static void lcd_control_temperature_preheat_abs_settings_menu(); static void lcd_control_motion_menu(); static void lcd_control_volumetric_menu(); - + static void lcd_change_filament_menu(); + static void lcd_insert_filament(); #if ENABLED(HAS_LCD_CONTRAST) static void lcd_set_contrast(); #endif @@ -495,6 +502,9 @@ inline void line_to_current(AxisEnum axis) { static void lcd_main_menu() { START_MENU(); MENU_ITEM(back, MSG_WATCH); + #if ENABLED(MANUAL_FILAMENT_CHANGE) + MENU_ITEM(submenu, MSG_CHANGE_FILAMENT, lcd_change_filament_menu); + #endif if (planner.movesplanned() || IS_SD_PRINTING) { MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); } @@ -755,7 +765,7 @@ static void lcd_tune_menu() { // // Change filament // - #if ENABLED(FILAMENTCHANGEENABLE) + #if ENABLED(FILAMENTCHANGEENABLE) && DISABLED(MANUAL_FILAMENT_CHANGE) MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600")); #endif @@ -1091,6 +1101,80 @@ void lcd_cooldown() { #endif // MANUAL_BED_LEVELING +#if ENABLED(MANUAL_FILAMENT_CHANGE) + + /** + * + * "Change Filament" submenu + * + */ + + static void lcd_set_mfc_state(MFCState state) { + mfc_state = MFC_IDLE; + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + defer_return_to_status = mfc_state != MFC_IDLE; + } + + inline void lcd_stop_mfc() { lcd_set_mfc_state(MFC_IDLE); } + + static void lcd_mfc_move(MFCState state, float distance, float speed=) { + lcd_set_mfc_state(state); + + switch(state){ + case MFC_INSERTING_SLOW: + while (mfc_filament_slow_inserting) { + current_position[E_AXIS] += distance; + planner.buffer_line(current_position[(X_AXIS)], current_position[(Y_AXIS)], current_position[(Z_AXIS)], current_position[E_AXIS], speed, active_extruder); + stepper.synchronize(); + } + break; + case MFC_INSERTING: + current_position[E_AXIS] += distance; + planner.buffer_line(current_position[(X_AXIS)], current_position[(Y_AXIS)], current_position[(Z_AXIS)], current_position[E_AXIS], speed, active_extruder); + stepper.synchronize(); + break; + + case MFC_EJECTING: + current_position[E_AXIS] -= distance; + planner.buffer_line(current_position[(X_AXIS)], current_position[(Y_AXIS)], current_position[(Z_AXIS)], current_position[E_AXIS], speed, active_extruder); + stepper.synchronize(); + break; + } + lcd_stop_mfc(); + } + static void lcd_eject_filament() { lcd_mfc_move(MFC_EJECTING, FILAMENT_LOAD_LENGTH, FILAMENT_CHANGE_NORMAL_SPEED); } + static void lcd_insert_filament() { lcd_mfc_move(MFC_INSERTING,FILAMENT_LOAD_LENGTH, FILAMENT_CHANGE_NORMAL_SPEED); } + static void lcd_insert_filament_slow_callback() { lcd_mfc_move(MFC_INSERTING_SLOW, 1.0, FILAMENT_CHANGE_SLOW_SPEED); } + + static void lcd_insert_filament_menu() { + START_MENU(); + MENU_ITEM(back, MSG_CHANGE_FILAMENT); + MENU_ITEM_EDIT_CALLBACK(bool, MSG_INSERT_FILAMENT_SLOW, &mfc_filament_slow_inserting, lcd_insert_filament_slow_callback); + if (mfc_state == MFC_IDLE) MENU_ITEM(function, MSG_INSERT_FILAMENT, lcd_insert_filament); + END_MENU(); + } + + static void lcd_change_filament_menu() { + START_MENU(); + MENU_ITEM(back, MSG_MAIN); + switch (mfc_state) { + case MFC_IDLE: + MENU_ITEM(function, MSG_EJECT_FILAMENT, lcd_eject_filament); + MENU_ITEM(submenu, MSG_INSERT_FILAMENT, lcd_insert_filament_menu); + break; + case MFC_EJECTING: + MENU_ITEM(function, MSG_STOP_EJECT, lcd_stop_mfc); + break; + case MFC_INSERTING: + case MFC_INSERTING_SLOW: + MENU_ITEM(function, MSG_STOP_INSERT, lcd_stop_mfc); + break; + } + END_MENU(); + } + +#endif // MANUAL_FILAMENT_CHANGE + /** * * "Prepare" submenu