Browse Source

Revert breaking change to _FAN_PWM macro

Scott Lahteine 4 years ago
parent
commit
ee6003be87
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      Marlin/src/module/temperature.cpp

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

@@ -2591,9 +2591,10 @@ void Temperature::tick() {
2591 2591
       #endif
2592 2592
 
2593 2593
       #if ENABLED(FAN_SOFT_PWM)
2594
-        #define _FAN_PWM(N) do{ \
2595
-          const uint8_t spcf = (soft_pwm_count_fan[N] & pwm_mask) + (soft_pwm_amount_fan[N] >> 1); \
2596
-          WRITE_FAN(N, (spcf > pwm_mask)); \
2594
+        #define _FAN_PWM(N) do{                                     \
2595
+          uint8_t &spcf = soft_pwm_count_fan[N];                    \
2596
+          spcf = (spcf & pwm_mask) + (soft_pwm_amount_fan[N] >> 1); \
2597
+          WRITE_FAN(N, spcf > pwm_mask ? HIGH : LOW);               \
2597 2598
         }while(0)
2598 2599
         #if HAS_FAN0
2599 2600
           _FAN_PWM(0);

Loading…
Cancel
Save