From da8ccf75356f0b9e86310860c456c6b922f12e98 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sat, 28 Dec 2013 10:40:49 +0100 Subject: [PATCH] temp_achieved(): check only sensors/heaters turned on. Problem spotted, described in a helpful manner and over-fixed by @zungmann. This fix picks up his basic idea and implements it with already existing state properties. --- temp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/temp.c b/temp.c index e7e42f3..ed9a522 100644 --- a/temp.c +++ b/temp.c @@ -315,14 +315,17 @@ void temp_sensor_tick() { sersendf_P(PSTR("\n")); } -/// report whether all temp sensors are reading their target temperatures -/// used for M116 and friends +/** + * Report whether all temp sensors in use are reading their target + * temperatures. Used for M116 and friends. + */ uint8_t temp_achieved() { temp_sensor_t i; uint8_t all_ok = 255; for (i = 0; i < NUM_TEMP_SENSORS; i++) { - if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100)) + if (temp_sensors_runtime[i].target_temp > 0 && + temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100)) all_ok = 0; } return all_ok;