Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@

#define MSG_FILAMENT_CHANGE_HEAT "Press button (or M108) to heat nozzle"
#define MSG_FILAMENT_CHANGE_INSERT "Insert filament and press button (or M108)"
#define MSG_FILAMENT_CHANGE_WAIT "Press button (or M108) to resume"
#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button"
#define MSG_FILAMENT_CHANGE_WAIT_LCD "Press button to resume"
#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle"
#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108"
#define MSG_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume"

#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!"

Expand Down
56 changes: 27 additions & 29 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_
#endif

#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode);
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_HEATING, mode);
#else
UNUSED(mode);
#endif
Expand Down Expand Up @@ -413,14 +413,27 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
*
* Used by M125 and M600
*/
void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
bool nozzle_timed_out = false;

#if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
#define _PMSG(L) L
#elif ENABLED(EMERGENCY_PARSER)
#define _PMSG(L) L##_M108
#else
#define _PMSG(L) L##_LCD
#endif

void show_continue_prompt(const bool is_reload) {
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
lcd_advanced_pause_show_message(is_reload ? ADVANCED_PAUSE_MESSAGE_INSERT : ADVANCED_PAUSE_MESSAGE_WAITING);
#endif
SERIAL_ECHO_START();
SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT);
serialprintPGM(is_reload ? PSTR(_PMSG(MSG_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(MSG_FILAMENT_CHANGE_WAIT) "\n"));
}

void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {
bool nozzle_timed_out = false;

show_continue_prompt(is_reload);

#if HAS_BUZZER
filament_change_beep(max_beep_count, true);
Expand All @@ -447,24 +460,18 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
filament_change_beep(max_beep_count);
#endif

// If the nozzle has timed out, wait for the user to press the button to re-heat the nozzle, then
// re-heat the nozzle, re-show the insert screen, restart the idle timers, and start over
// If the nozzle has timed out...
if (!nozzle_timed_out)
HOTEND_LOOP()
nozzle_timed_out |= thermalManager.is_heater_idle(e);
HOTEND_LOOP() nozzle_timed_out |= thermalManager.is_heater_idle(e);

// Wait for the user to press the button to re-heat the nozzle, then
// re-heat the nozzle, re-show the continue prompt, restart idle timers, start over
if (nozzle_timed_out) {
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_HEAT);
#endif
SERIAL_ECHO_START();
#if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT);
#elif ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108);
#else
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT_LCD);
#endif
SERIAL_ECHOLNPGM(_PMSG(MSG_FILAMENT_CHANGE_HEAT));

// Wait for LCD click or M108
while (wait_for_user) idle(true);
Expand All @@ -475,25 +482,16 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
// Wait for the heaters to reach the target temperatures
ensure_safe_temperature();

#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
#endif
SERIAL_ECHO_START();
#if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
#elif ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108);
#else
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT_LCD);
#endif
// Show the prompt to continue
show_continue_prompt(is_reload);

// Start the heater idle timers
const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL;

HOTEND_LOOP()
thermalManager.start_heater_idle_timer(e, nozzle_timeout);

wait_for_user = true; // Wait for user to load filament
wait_for_user = true;
nozzle_timed_out = false;

#if HAS_BUZZER
Expand Down
10 changes: 6 additions & 4 deletions Marlin/src/feature/pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@ enum AdvancedPauseMode : char {

enum AdvancedPauseMessage : char {
ADVANCED_PAUSE_MESSAGE_INIT,
ADVANCED_PAUSE_MESSAGE_WAITING,
ADVANCED_PAUSE_MESSAGE_UNLOAD,
ADVANCED_PAUSE_MESSAGE_INSERT,
ADVANCED_PAUSE_MESSAGE_LOAD,
ADVANCED_PAUSE_MESSAGE_PURGE,
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE,
#else
ADVANCED_PAUSE_MESSAGE_PURGE,
#endif
ADVANCED_PAUSE_MESSAGE_OPTION,
ADVANCED_PAUSE_MESSAGE_RESUME,
ADVANCED_PAUSE_MESSAGE_STATUS,
ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE,
ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT
ADVANCED_PAUSE_MESSAGE_HEAT,
ADVANCED_PAUSE_MESSAGE_HEATING
};

enum AdvancedPauseMenuResponse : char {
Expand Down Expand Up @@ -84,7 +86,7 @@ void do_pause_e_move(const float &length, const float &fr);

bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS);

void wait_for_filament_reload(const int8_t max_beep_count=0 DXC_PARAMS);
void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);

void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0 DXC_PARAMS);

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/feature/pause/M125.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ void GcodeSuite::M125() {
const bool job_running = print_job_timer.isRunning();

if (pause_print(retract, park_point) && !IS_SD_PRINTING()) {
wait_for_filament_reload(); // Wait for lcd click or M108
resume_print(); // Return to print position and continue
wait_for_confirmation(); // Wait for lcd click or M108
resume_print(); // Return to print position and continue
}

if (job_running) print_job_timer.start();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/feature/pause/M600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void GcodeSuite::M600() {
const bool job_running = print_job_timer.isRunning();

if (pause_print(retract, park_point, unload_length, true DXC_PASS)) {
wait_for_filament_reload(beep_count DXC_PASS);
wait_for_confirmation(true, beep_count DXC_PASS);
resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS);
}

Expand Down
63 changes: 35 additions & 28 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,63 +1097,70 @@
// ...or up to 2 lines on a 3-line display
//
#if LCD_HEIGHT >= 4
#ifndef MSG_FILAMENT_CHANGE_INIT_1
#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start")
#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament")
#define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change")
#ifndef MSG_ADVANCED_PAUSE_WAITING_1
#define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Press button")
#define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("to resume print")
#endif
#ifndef MSG_FILAMENT_CHANGE_UNLOAD_1
#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload")
#ifndef MSG_FILAMENT_CHANGE_INIT_1
#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filament change")
#define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("to start")
#endif
#ifndef MSG_FILAMENT_CHANGE_INSERT_1
#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament")
#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button")
#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...")
#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament")
#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button")
#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEAT_1
#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to")
#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.")
#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button")
#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("to heat nozzle")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEATING_1
#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle")
#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...")
#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozzle heating")
#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...")
#endif
#ifndef MSG_FILAMENT_CHANGE_UNLOAD_1
#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload")
#endif
#ifndef MSG_FILAMENT_CHANGE_LOAD_1
#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load")
#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load")
#endif
#ifndef MSG_FILAMENT_CHANGE_PURGE_1
#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge")
#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge")
#endif
#ifndef MSG_FILAMENT_CHANGE_RESUME_1
#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print")
#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume")
#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print")
#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume...")
#endif
#else // LCD_HEIGHT < 4
#ifndef MSG_ADVANCED_PAUSE_WAITING_1
#define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Click to continue")
#endif
#ifndef MSG_FILAMENT_CHANGE_INIT_1
#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Please wait...")
#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Please wait...")
#endif
#ifndef MSG_FILAMENT_CHANGE_UNLOAD_1
#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...")
#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...")
#endif
#ifndef MSG_FILAMENT_CHANGE_INSERT_1
#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click")
#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEAT_1
#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Click to heat")
#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Click to heat")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEATING_1
#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...")
#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...")
#endif
#ifndef MSG_FILAMENT_CHANGE_LOAD_1
#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...")
#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...")
#endif
#ifndef MSG_FILAMENT_CHANGE_PURGE_1
#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...")
#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...")
#endif
#ifndef MSG_FILAMENT_CHANGE_RESUME_1
#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...")
#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...")
#endif
#endif // LCD_HEIGHT < 4
Loading