Clean up Temperature::set_fans_paused

This commit is contained in:
Scott Lahteine 2019-05-04 14:36:59 -05:00
parent c791d2abeb
commit 2f32a6612d
2 changed files with 3 additions and 4 deletions

View file

@ -136,7 +136,6 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
#if ENABLED(PROBING_FANS_OFF)
bool Temperature::fans_paused; // = false;
uint8_t Temperature::paused_fan_speed[FAN_COUNT]; // = { 0 }
#endif
#if ENABLED(ADAPTIVE_FAN_SLOWING)
@ -178,12 +177,13 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
#if ENABLED(PROBING_FANS_OFF)
void Temperature::set_fans_paused(const bool p) {
static uint8_t saved_fan_speed[FAN_COUNT]; // = { 0 }
if (p != fans_paused) {
fans_paused = p;
if (p)
FANS_LOOP(x) { paused_fan_speed[x] = fan_speed[x]; fan_speed[x] = 0; }
FANS_LOOP(i) { saved_fan_speed[i] = fan_speed[i]; fan_speed[i] = 0; }
else
FANS_LOOP(x) fan_speed[x] = paused_fan_speed[x];
FANS_LOOP(i) fan_speed[i] = saved_fan_speed[i];
}
}

View file

@ -405,7 +405,6 @@ class Temperature {
#if ENABLED(PROBING_FANS_OFF)
static bool fans_paused;
static uint8_t paused_fan_speed[FAN_COUNT];
#endif
static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }