Browse Source

Ignore S and P if no value >0 is included.

Scott Lahteine 10 years ago
parent
commit
d407a43ac1
1 changed files with 9 additions and 6 deletions
  1. 9
    6
      Marlin/Marlin_main.cpp

+ 9
- 6
Marlin/Marlin_main.cpp View File

@@ -1844,12 +1844,15 @@ void process_commands()
1844 1844
 
1845 1845
       codenum = 0;
1846 1846
 
1847
-      bool hasP = code_seen('P');
1848
-      if (hasP) codenum = code_value(); // milliseconds to wait
1849
-
1850
-      bool hasS = code_seen('S');
1851
-      if (hasS) codenum = code_value() * 1000; // seconds to wait
1852
-
1847
+      bool hasP = false, hasS = false;
1848
+      if (code_seen('P')) {
1849
+        codenum = code_value(); // milliseconds to wait
1850
+        hasP = codenum > 0;
1851
+      }
1852
+      if (code_seen('S')) {
1853
+        codenum = code_value() * 1000; // seconds to wait
1854
+        hasS = codenum > 0;
1855
+      }
1853 1856
       if (!hasP && !hasS && *src != '\0') {
1854 1857
         starpos = strchr(src, '*');
1855 1858
         if (starpos != NULL) *(starpos) = '\0';

Loading…
Cancel
Save