From 78ea4871f9916e859e8a7b45cc8d62612d382fd8 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Thu, 19 Apr 2018 18:11:03 -0500
Subject: [PATCH] Fix up enqueue now functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

…and apply to MALYAN_LCD.
---
 Marlin/src/gcode/queue.cpp   |  6 +++---
 Marlin/src/gcode/queue.h     |  6 +++---
 Marlin/src/lcd/malyanlcd.cpp | 10 +++++-----
 Marlin/src/lcd/ultralcd.cpp  |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp
index 169aa3add5..7ac8c7912e 100644
--- a/Marlin/src/gcode/queue.cpp
+++ b/Marlin/src/gcode/queue.cpp
@@ -176,14 +176,14 @@ void enqueue_and_echo_commands_P(const char * const pgcode) {
   /**
    * Enqueue and return only when commands are actually enqueued
    */
-  void enqueue_and_echo_command_now(const char* cmd, bool say_ok/*=false*/) {
-    while (!enqueue_and_echo_command(cmd, say_ok)) idle();
+  void enqueue_and_echo_command_now(const char* cmd) {
+    while (!enqueue_and_echo_command(cmd)) idle();
   }
   #if HAS_LCD_QUEUE_NOW
     /**
      * Enqueue from program memory and return only when commands are actually enqueued
      */
-    void enqueue_and_echo_commands_P_now(const char * const pgcode) {
+    void enqueue_and_echo_commands_now_P(const char * const pgcode) {
       enqueue_and_echo_commands_P(pgcode);
       while (drain_injected_commands_P()) idle();
     }
diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h
index 68e9de65aa..29c2ac86bc 100644
--- a/Marlin/src/gcode/queue.h
+++ b/Marlin/src/gcode/queue.h
@@ -97,19 +97,19 @@ void enqueue_and_echo_commands_P(const char * const pgcode);
  */
 bool enqueue_and_echo_command(const char* cmd, bool say_ok=false);
 
-#define HAS_LCD_QUEUE_NOW (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))
+#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
 #define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
 
 #if HAS_QUEUE_NOW
   /**
    * Enqueue and return only when commands are actually enqueued
    */
-  void enqueue_and_echo_command_now(const char* cmd, bool say_ok=false);
+  void enqueue_and_echo_command_now(const char* cmd);
   #if HAS_LCD_QUEUE_NOW
     /**
      * Enqueue from program memory and return only when commands are actually enqueued
      */
-    void enqueue_and_echo_commands_P_now(const char * const cmd);
+    void enqueue_and_echo_commands_now_P(const char * const cmd);
   #endif
 #endif
 
diff --git a/Marlin/src/lcd/malyanlcd.cpp b/Marlin/src/lcd/malyanlcd.cpp
index 2292abd1b1..ea2bdd7283 100644
--- a/Marlin/src/lcd/malyanlcd.cpp
+++ b/Marlin/src/lcd/malyanlcd.cpp
@@ -109,14 +109,14 @@ void process_lcd_c_command(const char* command) {
       // M104 S<temperature>
       char cmd[20];
       sprintf_P(cmd, PSTR("M104 S%s"), command + 1);
-      enqueue_and_echo_command_now(cmd, false);
+      enqueue_and_echo_command_now(cmd);
     } break;
 
     case 'P': {
       // M140 S<temperature>
       char cmd[20];
       sprintf_P(cmd, PSTR("M140 S%s"), command + 1);
-      enqueue_and_echo_command_now(cmd, false);
+      enqueue_and_echo_command_now(cmd);
     } break;
 
     default:
@@ -178,8 +178,8 @@ void process_lcd_j_command(const char* command) {
     case 'E':
       // enable or disable steppers
       // switch to relative
-      enqueue_and_echo_command_now("G91");
-      enqueue_and_echo_command_now(steppers_enabled ? "M18" : "M17");
+      enqueue_and_echo_commands_now_P(PSTR("G91"));
+      enqueue_and_echo_commands_now_P(steppers_enabled ? PSTR("M18") : PSTR("M17"));
       steppers_enabled = !steppers_enabled;
       break;
     case 'A':
@@ -245,7 +245,7 @@ void process_lcd_p_command(const char* command) {
       break;
     case 'H':
       // Home all axis
-      enqueue_and_echo_command_now("G28");
+      enqueue_and_echo_commands_now_P(PSTR("G28"));
       break;
     default: {
       // Print file 000 - a three digit number indicating which
diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp
index bf2a6c87b8..106b805979 100644
--- a/Marlin/src/lcd/ultralcd.cpp
+++ b/Marlin/src/lcd/ultralcd.cpp
@@ -1719,7 +1719,7 @@ void kill_screen(const char* lcd_msg) {
 
     void lcd_enqueue_commands_P(const char * const cmd) {
       no_reentry = true;
-      enqueue_and_echo_commands_P_now(cmd);
+      enqueue_and_echo_commands_now_P(cmd);
       no_reentry = false;
     }
 
-- 
GitLab