Browse Source

Clean up Temperature::set_fans_paused

Scott Lahteine 5 years ago
parent
commit
2f32a6612d
2 changed files with 3 additions and 4 deletions
  1. 3
    3
      Marlin/src/module/temperature.cpp
  2. 0
    1
      Marlin/src/module/temperature.h

+ 3
- 3
Marlin/src/module/temperature.cpp View File

@@ -136,7 +136,6 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
136 136
 
137 137
   #if ENABLED(PROBING_FANS_OFF)
138 138
     bool Temperature::fans_paused; // = false;
139
-    uint8_t Temperature::paused_fan_speed[FAN_COUNT]; // = { 0 }
140 139
   #endif
141 140
 
142 141
   #if ENABLED(ADAPTIVE_FAN_SLOWING)
@@ -178,12 +177,13 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
178 177
   #if ENABLED(PROBING_FANS_OFF)
179 178
 
180 179
     void Temperature::set_fans_paused(const bool p) {
180
+      static uint8_t saved_fan_speed[FAN_COUNT]; // = { 0 }
181 181
       if (p != fans_paused) {
182 182
         fans_paused = p;
183 183
         if (p)
184
-          FANS_LOOP(x) { paused_fan_speed[x] = fan_speed[x]; fan_speed[x] = 0; }
184
+          FANS_LOOP(i) { saved_fan_speed[i] = fan_speed[i]; fan_speed[i] = 0; }
185 185
         else
186
-          FANS_LOOP(x) fan_speed[x] = paused_fan_speed[x];
186
+          FANS_LOOP(i) fan_speed[i] = saved_fan_speed[i];
187 187
       }
188 188
     }
189 189
 

+ 0
- 1
Marlin/src/module/temperature.h View File

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

Loading…
Cancel
Save