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
 
136
 
137
   #if ENABLED(PROBING_FANS_OFF)
137
   #if ENABLED(PROBING_FANS_OFF)
138
     bool Temperature::fans_paused; // = false;
138
     bool Temperature::fans_paused; // = false;
139
-    uint8_t Temperature::paused_fan_speed[FAN_COUNT]; // = { 0 }
140
   #endif
139
   #endif
141
 
140
 
142
   #if ENABLED(ADAPTIVE_FAN_SLOWING)
141
   #if ENABLED(ADAPTIVE_FAN_SLOWING)
178
   #if ENABLED(PROBING_FANS_OFF)
177
   #if ENABLED(PROBING_FANS_OFF)
179
 
178
 
180
     void Temperature::set_fans_paused(const bool p) {
179
     void Temperature::set_fans_paused(const bool p) {
180
+      static uint8_t saved_fan_speed[FAN_COUNT]; // = { 0 }
181
       if (p != fans_paused) {
181
       if (p != fans_paused) {
182
         fans_paused = p;
182
         fans_paused = p;
183
         if (p)
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
         else
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
 
405
 
406
       #if ENABLED(PROBING_FANS_OFF)
406
       #if ENABLED(PROBING_FANS_OFF)
407
         static bool fans_paused;
407
         static bool fans_paused;
408
-        static uint8_t paused_fan_speed[FAN_COUNT];
409
       #endif
408
       #endif
410
 
409
 
411
       static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }
410
       static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }

Loading…
Cancel
Save