From 2f32a6612d0155fd01d15497205bb63e68ae1e7a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 May 2019 14:36:59 -0500 Subject: [PATCH] Clean up Temperature::set_fans_paused --- Marlin/src/module/temperature.cpp | 6 +++--- Marlin/src/module/temperature.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 957b2db2ab..1c22df4d1e 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -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]; } } diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index b24f84fb58..3dadaf2b77 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -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); }