Pārlūkot izejas kodu

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

jbrazio 9 gadus atpakaļ
vecāks
revīzija
1981e53d68
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4
    0
      Marlin/Marlin_main.cpp

+ 4
- 0
Marlin/Marlin_main.cpp Parādīt failu

@@ -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

Notiek ielāde…
Atcelt
Saglabāt