Browse Source

Fix Fan 0 responding to all fan speeds (#13444)

Sam Lane 5 years ago
parent
commit
a8fa275dc6
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      Marlin/src/gcode/temperature/M106_M107.cpp
  2. 1
    1
      Marlin/src/module/temperature.cpp

+ 2
- 2
Marlin/src/gcode/temperature/M106_M107.cpp View File

@@ -58,8 +58,8 @@ void GcodeSuite::M106() {
58 58
       const uint16_t t = parser.intval('T');
59 59
       if (t > 0) return thermalManager.set_temp_fan_speed(p, t);
60 60
     #endif
61
-
62
-    uint16_t s = parser.ushortval('S', 255);
61
+    uint16_t d = parser.seen('A') ? thermalManager.fan_speed[active_extruder] : 255;
62
+    uint16_t s = parser.ushortval('S', d);
63 63
     NOMORE(s, 255U);
64 64
 
65 65
     thermalManager.set_fan_speed(p, s);

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

@@ -2379,7 +2379,7 @@ void Temperature::isr() {
2379 2379
       #if ENABLED(FAN_SOFT_PWM)
2380 2380
         #define _FAN_PWM(N) do{ \
2381 2381
           soft_pwm_count_fan[N] = (soft_pwm_count_fan[N] & pwm_mask) + (soft_pwm_amount_fan[N] >> 1); \
2382
-          WRITE_FAN(soft_pwm_count_fan[N] > pwm_mask ? HIGH : LOW); \
2382
+          WRITE_FAN_N(N, soft_pwm_count_fan[N] > pwm_mask ? HIGH : LOW); \
2383 2383
         }while(0)
2384 2384
         #if HAS_FAN0
2385 2385
           _FAN_PWM(0);

Loading…
Cancel
Save