Move 'last_pause_state' closer to usage

This commit is contained in:
Scott Lahteine 2020-03-07 22:34:33 -06:00
parent 7f490c08da
commit b579f5dc99

View File

@ -1030,10 +1030,6 @@ void Temperature::manage_heater() {
if (!inited) return watchdog_refresh();
#endif
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
static bool last_pause_state;
#endif
#if ENABLED(EMERGENCY_PARSER)
if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true);
#endif
@ -1125,16 +1121,21 @@ void Temperature::manage_heater() {
}
#endif // WATCH_BED
#define PAUSE_CHANGE_REQD BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
#if PAUSE_CHANGE_REQD
static bool last_pause_state;
#endif
do {
#if DISABLED(PIDTEMPBED)
if (PENDING(ms, next_bed_check_ms)
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
#if PAUSE_CHANGE_REQD
&& paused == last_pause_state
#endif
) break;
next_bed_check_ms = ms + BED_CHECK_INTERVAL;
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
#if PAUSE_CHANGE_REQD
last_pause_state = paused;
#endif
#endif