From 5221e2d991ccae7ff4283a60afb240165c8f0199 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Fri, 27 Sep 2019 18:06:26 -0400 Subject: [PATCH] Restore Host Prompt Info (#15387) --- Marlin/src/Marlin.cpp | 6 +++++- Marlin/src/feature/host_actions.cpp | 3 +++ Marlin/src/feature/host_actions.h | 3 ++- Marlin/src/feature/pause.cpp | 10 +++++++++- Marlin/src/gcode/sdcard/M24_M25.cpp | 3 +++ Marlin/src/lcd/ultralcd.cpp | 3 +++ 6 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 0dca9879d..89501e9bf 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -414,7 +414,7 @@ void disable_all_steppers() { void event_probe_recover() { #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying")); + host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), PSTR("Dismiss")); #endif #ifdef ACTION_ON_G29_RECOVER host_action(PSTR(ACTION_ON_G29_RECOVER)); @@ -1155,6 +1155,10 @@ void setup() { card.beginautostart(); #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_prompt_end(); + #endif + #if HAS_TRINAMIC && DISABLED(PS_DEFAULT_OFF) test_tmc_connection(true, true, true, true); #endif diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index 26c24aaf4..b39b0fbc3 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -154,6 +154,9 @@ void host_action(const char * const pstr, const bool eol) { queue.inject_P(PSTR("M24")); #endif break; + case PROMPT_INFO: + msg = PSTR("GCODE_INFO"); + break; default: break; } say_m876_response(msg); diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 11078ce20..7477b6e6d 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -51,7 +51,8 @@ void host_action(const char * const pstr, const bool eol=true); PROMPT_FILAMENT_RUNOUT, PROMPT_USER_CONTINUE, PROMPT_FILAMENT_RUNOUT_REHEAT, - PROMPT_PAUSE_RESUME + PROMPT_PAUSE_RESUME, + PROMPT_INFO }; extern PromptReason host_prompt_reason; diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index cf9f1838d..ff200d0af 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -401,6 +401,10 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u #endif #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Pause"), PSTR("Dismiss")); + #endif + if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); @@ -554,7 +558,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep while (wait_for_user) idle(true); #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheating")); + host_prompt_do(PROMPT_INFO, PSTR("Reheating")); #endif #if ENABLED(EXTENSIBLE_UI) ExtUI::onStatusChanged(PSTR("Reheating...")); @@ -676,6 +680,10 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le --did_pause_print; + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Resuming"), PSTR("Dismiss")); + #endif + #if ENABLED(SDSUPPORT) if (did_pause_print) { card.startFileprint(); diff --git a/Marlin/src/gcode/sdcard/M24_M25.cpp b/Marlin/src/gcode/sdcard/M24_M25.cpp index 12d5313fc..154a4f7c5 100644 --- a/Marlin/src/gcode/sdcard/M24_M25.cpp +++ b/Marlin/src/gcode/sdcard/M24_M25.cpp @@ -71,6 +71,9 @@ void GcodeSuite::M24() { #ifdef ACTION_ON_RESUME host_action_resume(); #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), PSTR("Dismiss")); + #endif #endif ui.reset_status(); diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 390e0f17f..389a58f2d 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -1481,6 +1481,9 @@ void MarlinUI::update() { #ifdef ACTION_ON_CANCEL host_action_cancel(); #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), PSTR("Dismiss")); + #endif print_job_timer.stop(); set_status_P(PSTR(MSG_PRINT_ABORTED)); #if HAS_LCD_MENU