Fix M876 when called from EP (#21210)

This commit is contained in:
Arjan Mels 2021-02-27 20:32:57 +01:00 committed by GitHub
parent 6136959a6a
commit 83a156ef47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -143,24 +143,16 @@ void host_action(PGM_P const pstr, const bool eol) {
// - Dismissal of info
//
void host_response_handler(const uint8_t response) {
#ifdef DEBUG_HOST_ACTIONS
static PGMSTR(m876_prefix, "M876 Handle Re");
serialprintPGM(m876_prefix); SERIAL_ECHOLNPAIR("ason: ", host_prompt_reason);
serialprintPGM(m876_prefix); SERIAL_ECHOLNPAIR("sponse: ", response);
#endif
PGM_P msg = PSTR("UNKNOWN STATE");
const PromptReason hpr = host_prompt_reason;
host_prompt_reason = PROMPT_NOT_DEFINED; // Reset now ahead of logic
switch (hpr) {
case PROMPT_FILAMENT_RUNOUT:
msg = PSTR("FILAMENT_RUNOUT");
switch (response) {
case 0: // "Purge More" button
#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more)
#endif
filament_load_host_prompt(); // Initiate another host prompt. (NOTE: The loop in load_filament may also do this!)
break;
case 1: // "Continue" / "Disable Runout" button
@ -178,23 +170,17 @@ void host_action(PGM_P const pstr, const bool eol) {
break;
case PROMPT_USER_CONTINUE:
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);
msg = PSTR("FILAMENT_RUNOUT_CONTINUE");
break;
case PROMPT_PAUSE_RESUME:
msg = PSTR("LCD_PAUSE_RESUME");
#if BOTH(ADVANCED_PAUSE_FEATURE, SDSUPPORT)
extern const char M24_STR[];
queue.inject_P(M24_STR);
#endif
break;
case PROMPT_INFO:
msg = PSTR("GCODE_INFO");
break;
default: break;
}
SERIAL_ECHOPGM("M876 Responding PROMPT_");
serialprintPGM(msg);
SERIAL_EOL();
}
#endif // HOST_PROMPT_SUPPORT

View File

@ -259,7 +259,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
}
TERN_(HOST_PROMPT_SUPPORT, filament_load_host_prompt()); // Initiate another host prompt. (NOTE: host_response_handler may also do this!)
TERN_(HOST_PROMPT_SUPPORT, filament_load_host_prompt()); // Initiate another host prompt.
#if HAS_LCD_MENU
if (show_lcd) {