Clean up Temperature::set_fans_paused
This commit is contained in:
parent
c791d2abeb
commit
2f32a6612d
|
@ -136,7 +136,6 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
|
||||||
|
|
||||||
#if ENABLED(PROBING_FANS_OFF)
|
#if ENABLED(PROBING_FANS_OFF)
|
||||||
bool Temperature::fans_paused; // = false;
|
bool Temperature::fans_paused; // = false;
|
||||||
uint8_t Temperature::paused_fan_speed[FAN_COUNT]; // = { 0 }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
||||||
|
@ -178,12 +177,13 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
|
||||||
#if ENABLED(PROBING_FANS_OFF)
|
#if ENABLED(PROBING_FANS_OFF)
|
||||||
|
|
||||||
void Temperature::set_fans_paused(const bool p) {
|
void Temperature::set_fans_paused(const bool p) {
|
||||||
|
static uint8_t saved_fan_speed[FAN_COUNT]; // = { 0 }
|
||||||
if (p != fans_paused) {
|
if (p != fans_paused) {
|
||||||
fans_paused = p;
|
fans_paused = p;
|
||||||
if (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
|
else
|
||||||
FANS_LOOP(x) fan_speed[x] = paused_fan_speed[x];
|
FANS_LOOP(i) fan_speed[i] = saved_fan_speed[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -405,7 +405,6 @@ class Temperature {
|
||||||
|
|
||||||
#if ENABLED(PROBING_FANS_OFF)
|
#if ENABLED(PROBING_FANS_OFF)
|
||||||
static bool fans_paused;
|
static bool fans_paused;
|
||||||
static uint8_t paused_fan_speed[FAN_COUNT];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }
|
static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }
|
||||||
|
|
Loading…
Reference in a new issue