瀏覽代碼

Only look for "N" line number as first parameter

Scott Lahteine 9 年之前
父節點
當前提交
c0e791dbe9
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      Marlin/Marlin_main.cpp

+ 4
- 2
Marlin/Marlin_main.cpp 查看文件

834
         fromsd[cmd_queue_index_w] = false;
834
         fromsd[cmd_queue_index_w] = false;
835
       #endif
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
       if (npos) {
841
       if (npos) {
840
 
842
 
841
         boolean M110 = strstr_P(command, PSTR("M110")) != NULL;
843
         boolean M110 = strstr_P(command, PSTR("M110")) != NULL;

Loading…
取消
儲存