浏览代码

Allow N to take a negative argument (PR@2402)

Scott Lahteine 10 年前
父节点
当前提交
2e0da8abdc
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      Marlin/Marlin_main.cpp

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

@@ -5307,8 +5307,8 @@ void process_next_command() {
5307 5307
   //  - Bypass N[0-9][0-9]*[ ]*
5308 5308
   //  - Overwrite * with nul to mark the end
5309 5309
   while (*current_command == ' ') ++current_command;
5310
-  if (*current_command == 'N' && current_command[1] >= '0' && current_command[1] <= '9') {
5311
-    current_command += 2; // skip N[0-9]
5310
+  if (*current_command == 'N' && ((current_command[1] >= '0' && current_command[1] <= '9') || current_command[1] == '-')) {
5311
+    current_command += 2; // skip N[-0-9]
5312 5312
     while (*current_command >= '0' && *current_command <= '9') ++current_command; // skip [0-9]*
5313 5313
     while (*current_command == ' ') ++current_command; // skip [ ]*
5314 5314
   }

正在加载...
取消
保存