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

This commit is contained in:
jbrazio 2016-03-12 06:24:24 +00:00
parent 7bb7ac8353
commit 1981e53d68

View file

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