Enable Purge More / Resume with EP + Host Prompt (#21671)

Co-authored-by: Msq001 <alansayyeah@gmail.com>
This commit is contained in:
BigTreeTech 2021-04-23 07:43:28 +08:00 committed by GitHub
parent f075dd0db3
commit a58276c4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 9 deletions

View File

@ -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

View File

@ -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
@ -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());

View File

@ -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,

View File

@ -2716,8 +2716,16 @@
#define HEATER_IDLE_HANDLER 1
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH)
/**
* 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)