浏览代码

fix bug where, i.e., "G1X1E1" would be interpretted as "G1 X10 E1",

because strtod() will read the E address value as if it was a base 10
exponent.
Greg Alexander 9 年前
父节点
当前提交
3e8c5678f5
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      Marlin/Marlin_main.cpp

+ 6
- 1
Marlin/Marlin_main.cpp 查看文件

@@ -909,7 +909,12 @@ void get_command()
909 909
 
910 910
 float code_value()
911 911
 {
912
-  return (strtod(strchr_pointer + 1, NULL));
912
+  float ret;
913
+  char *e = strchr(strchr_pointer, 'E');
914
+  if (e != NULL) *e = 0;
915
+  ret = strtod(strchr_pointer+1, NULL);
916
+  if (e != NULL) *e = 'E';
917
+  return ret;
913 918
 }
914 919
 
915 920
 long code_value_long()

正在加载...
取消
保存