From ee6003be8705da8a096780f433199299898af6bc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 1 Feb 2020 23:07:12 -0600 Subject: [PATCH] Revert breaking change to _FAN_PWM macro --- Marlin/src/module/temperature.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 9919c4e35..81068c7f7 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2591,9 +2591,10 @@ void Temperature::tick() { #endif #if ENABLED(FAN_SOFT_PWM) - #define _FAN_PWM(N) do{ \ - const uint8_t spcf = (soft_pwm_count_fan[N] & pwm_mask) + (soft_pwm_amount_fan[N] >> 1); \ - WRITE_FAN(N, (spcf > pwm_mask)); \ + #define _FAN_PWM(N) do{ \ + uint8_t &spcf = soft_pwm_count_fan[N]; \ + spcf = (spcf & pwm_mask) + (soft_pwm_amount_fan[N] >> 1); \ + WRITE_FAN(N, spcf > pwm_mask ? HIGH : LOW); \ }while(0) #if HAS_FAN0 _FAN_PWM(0);