Skip to content

Commit

Permalink
Enable Purge More / Resume with EP + Host Prompt (MarlinFirmware#21671)
Browse files Browse the repository at this point in the history
Co-authored-by: Msq001 <[email protected]>
  • Loading branch information
bigtreetech and Msq001 authored Apr 22, 2021
1 parent f075dd0 commit a58276c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/feature/host_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ void host_action(PGM_P const pstr, const bool eol) {
switch (response) {

case 0: // "Purge More" button
#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
#if BOTH(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE)
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more)
#endif
break;

case 1: // "Continue" / "Disable Runout" button
#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
#if BOTH(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE)
pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection
#endif
#if HAS_FILAMENT_SENSOR
Expand Down
12 changes: 8 additions & 4 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

static xyze_pos_t resume_position;

#if HAS_LCD_MENU
#if M600_PURGE_MORE_RESUMABLE
PauseMenuResponse pause_menu_response;
PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT;
#endif
Expand Down Expand Up @@ -257,18 +257,22 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load

TERN_(HOST_PROMPT_SUPPORT, filament_load_host_prompt()); // Initiate another host prompt.

#if HAS_LCD_MENU
#if M600_PURGE_MORE_RESUMABLE
if (show_lcd) {
// Show "Purge More" / "Resume" menu and wait for reply
KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false;
ui.pause_show_message(PAUSE_MESSAGE_OPTION);
#if HAS_LCD_MENU
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
#else
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
#endif
while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
}
#endif

// Keep looping if "Purge More" was selected
} while (TERN0(HAS_LCD_MENU, show_lcd && pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
} while (TERN0(M600_PURGE_MORE_RESUMABLE, show_lcd && pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));

#endif
TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ enum PauseMessage : char {
PAUSE_MESSAGE_HEATING
};

#if HAS_LCD_MENU
#if M600_PURGE_MORE_RESUMABLE
enum PauseMenuResponse : char {
PAUSE_RESPONSE_WAIT_FOR,
PAUSE_RESPONSE_EXTRUDE_MORE,
Expand Down
12 changes: 10 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2716,8 +2716,16 @@
#define HEATER_IDLE_HANDLER 1
#endif

#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH)
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0
/**
* Advanced Pause - Filament Change
*/
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HAS_LCD_MENU || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT)
#define M600_PURGE_MORE_RESUMABLE 1
#endif
#ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0
#endif
#endif

#if HAS_MULTI_EXTRUDER && !defined(TOOLCHANGE_FS_EXTRA_PRIME)
Expand Down

0 comments on commit a58276c

Please sign in to comment.