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