浏览代码

M109 R option if misused could cause a wait-forever situation

jbrazio 9 年前
父节点
当前提交
1981e53d68
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      Marlin/Marlin_main.cpp

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

@@ -3940,6 +3940,10 @@ inline void gcode_M109() {
3940 3940
   // Exit if the temperature is above target and not waiting for cooling
3941 3941
   if (no_wait_for_cooling && !isHeatingHotend(target_extruder)) return;
3942 3942
 
3943
+  // Prevents a wait-forever situation if R is misused i.e. M109 R0
3944
+  // Try to calculate a ballpark safe margin by halving EXTRUDE_MINTEMP
3945
+  if (degTargetHotend(target_extruder) < (EXTRUDE_MINTEMP/2)) return;
3946
+
3943 3947
   #ifdef TEMP_RESIDENCY_TIME
3944 3948
     long residency_start_ms = -1;
3945 3949
     // Loop until the temperature has stabilized

正在加载...
取消
保存