From 12b51d6060f9b8603e67908a09d81e56211bda36 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 26 Nov 2014 09:21:37 -0800 Subject: [PATCH] Ignore S and P if no value >0 is included. --- Marlin/Marlin_main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1b8b2f979e..5e49b89a87 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1866,12 +1866,15 @@ void process_commands() codenum = 0; - bool hasP = code_seen('P'); - if (hasP) codenum = code_value(); // milliseconds to wait - - bool hasS = code_seen('S'); - if (hasS) codenum = code_value() * 1000; // seconds to wait - + bool hasP = false, hasS = false; + if (code_seen('P')) { + codenum = code_value(); // milliseconds to wait + hasP = codenum > 0; + } + if (code_seen('S')) { + codenum = code_value() * 1000; // seconds to wait + hasS = codenum > 0; + } if (!hasP && !hasS && *src != '\0') { starpos = strchr(src, '*'); if (starpos != NULL) *(starpos) = '\0';