Fix Thermal Runaway false-alarm in M303, add HeaterWatch::check (#21743)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
David
2021-04-30 08:51:26 +02:00
committed by GitHub
parent 636facf40d
commit cfdfd16779
2 changed files with 15 additions and 13 deletions

View File

@@ -233,6 +233,8 @@ struct HeaterWatch {
inline bool elapsed(const millis_t &ms) { return next_ms && ELAPSED(ms, next_ms); }
inline bool elapsed() { return elapsed(millis()); }
inline bool check(const celsius_t curr) { return curr >= target; }
inline void restart(const celsius_t curr, const celsius_t tgt) {
if (tgt) {
const celsius_t newtarget = curr + INCREASE;