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.
This commit is contained in:
parent
95a44e8777
commit
da8ccf7535
9
temp.c
9
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue