From 073e4443e8b8624078138a0c6f422cccc2959a86 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Feb 2020 00:05:06 -0600 Subject: [PATCH] Optimize "Dismiss" string --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/feature/host_actions.cpp | 3 ++- Marlin/src/feature/host_actions.h | 2 +- Marlin/src/feature/pause.cpp | 4 ++-- Marlin/src/gcode/sdcard/M24_M25.cpp | 2 +- Marlin/src/lcd/ultralcd.cpp | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index ecfdcc21b..b1e895d97 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -345,7 +345,7 @@ void disable_all_steppers() { void event_probe_recover() { #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), PSTR("Dismiss")); + host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR); #endif #ifdef ACTION_ON_G29_RECOVER host_action(PSTR(ACTION_ON_G29_RECOVER)); diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index c9e87a623..2108f4e7f 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -64,7 +64,8 @@ void host_action(const char * const pstr, const bool eol) { #if ENABLED(HOST_PROMPT_SUPPORT) - const char CONTINUE_STR[] PROGMEM = "Continue"; + const char CONTINUE_STR[] PROGMEM = "Continue", + DISMISS_STR[] PROGMEM = "Dismiss"; #if HAS_RESUME_CONTINUE extern bool wait_for_user; diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index d90a21b1f..3667b7f43 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -46,7 +46,7 @@ void host_action(const char * const pstr, const bool eol=true); #if ENABLED(HOST_PROMPT_SUPPORT) - extern const char CONTINUE_STR[]; + extern const char CONTINUE_STR[], DISMISS_STR[]; enum PromptReason : uint8_t { PROMPT_NOT_DEFINED, diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 5a7cde204..9fd279fe5 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -396,7 +396,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float #endif #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Pause"), PSTR("Dismiss")); + host_prompt_open(PROMPT_INFO, PSTR("Pause"), DISMISS_STR); #endif if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { @@ -667,7 +667,7 @@ 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")); + host_prompt_open(PROMPT_INFO, PSTR("Resuming"), DISMISS_STR); #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/gcode/sdcard/M24_M25.cpp b/Marlin/src/gcode/sdcard/M24_M25.cpp index 02ba5acb3..967b6dfdf 100644 --- a/Marlin/src/gcode/sdcard/M24_M25.cpp +++ b/Marlin/src/gcode/sdcard/M24_M25.cpp @@ -74,7 +74,7 @@ void GcodeSuite::M24() { host_action_resume(); #endif #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), PSTR("Dismiss")); + host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), DISMISS_STR); #endif #endif diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 717a3f05d..8ad02acfb 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -1504,7 +1504,7 @@ void MarlinUI::update() { host_action_cancel(); #endif #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), PSTR("Dismiss")); + host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR); #endif print_job_timer.stop(); set_status_P(GET_TEXT(MSG_PRINT_ABORTED));