Browse Source

Only look for "N" line number as first parameter

Scott Lahteine 8 years ago
parent
commit
c0e791dbe9
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      Marlin/Marlin_main.cpp

+ 4
- 2
Marlin/Marlin_main.cpp View File

@@ -834,8 +834,10 @@ void get_command() {
834 834
         fromsd[cmd_queue_index_w] = false;
835 835
       #endif
836 836
 
837
-      char *npos = strchr(command, 'N');
838
-      char *apos = strchr(command, '*');
837
+      while (*command == ' ') command++; // skip any leading spaces
838
+      char* npos = (*command == 'N') ? command : NULL; // Require the N parameter to start the line
839
+      char* apos = strchr(command, '*');
840
+
839 841
       if (npos) {
840 842
 
841 843
         boolean M110 = strstr_P(command, PSTR("M110")) != NULL;

Loading…
Cancel
Save