Treat temperature as integer, when possible

This commit is contained in:
Scott Lahteine
2017-05-03 17:12:14 -05:00
parent 1b2c7ec20a
commit 2658cc707a
6 changed files with 89 additions and 91 deletions

View File

@ -387,10 +387,7 @@ void Planner::recalculate() {
float t = autotemp_min + high * autotemp_factor;
t = constrain(t, autotemp_min, autotemp_max);
if (oldt > t) {
t *= (1 - (AUTOTEMP_OLDWEIGHT));
t += (AUTOTEMP_OLDWEIGHT) * oldt;
}
if (t < oldt) t = t * (1 - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT);
oldt = t;
thermalManager.setTargetHotend(t, 0);
}