Browse Source

Patches for compiler warnings/errors

Scott Lahteine 7 years ago
parent
commit
91baca6abb
2 changed files with 4 additions and 5 deletions
  1. 1
    2
      Marlin/src/gcode/temperature/M106_M107.cpp
  2. 3
    3
      Marlin/src/module/temperature.cpp

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

45
   if (p < FAN_COUNT) {
45
   if (p < FAN_COUNT) {
46
     #if ENABLED(EXTRA_FAN_SPEED)
46
     #if ENABLED(EXTRA_FAN_SPEED)
47
       const int16_t t = parser.intval('T');
47
       const int16_t t = parser.intval('T');
48
-      NOMORE(t, 255);
49
       if (t > 0) {
48
       if (t > 0) {
50
         switch (t) {
49
         switch (t) {
51
           case 1:
50
           case 1:
56
             fanSpeeds[p] = new_fanSpeeds[p];
55
             fanSpeeds[p] = new_fanSpeeds[p];
57
             break;
56
             break;
58
           default:
57
           default:
59
-            new_fanSpeeds[p] = t;
58
+            new_fanSpeeds[p] = min(t, 255);
60
             break;
59
             break;
61
         }
60
         }
62
         return;
61
         return;

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

1717
 
1717
 
1718
       #if ENABLED(FAN_SOFT_PWM)
1718
       #if ENABLED(FAN_SOFT_PWM)
1719
         #if HAS_FAN0
1719
         #if HAS_FAN0
1720
-          soft_pwm_count_fan[0] = (soft_pwm_count_fan[0] & pwm_mask) + soft_pwm_amount_fan[0] >> 1;
1720
+          soft_pwm_count_fan[0] = ((soft_pwm_count_fan[0] & pwm_mask) + soft_pwm_amount_fan[0]) >> 1;
1721
           WRITE_FAN(soft_pwm_count_fan[0] > pwm_mask ? HIGH : LOW);
1721
           WRITE_FAN(soft_pwm_count_fan[0] > pwm_mask ? HIGH : LOW);
1722
         #endif
1722
         #endif
1723
         #if HAS_FAN1
1723
         #if HAS_FAN1
1724
-          soft_pwm_count_fan[1] = (soft_pwm_count_fan[1] & pwm_mask) + soft_pwm_amount_fan[1] >> 1;
1724
+          soft_pwm_count_fan[1] = ((soft_pwm_count_fan[1] & pwm_mask) + soft_pwm_amount_fan[1]) >> 1;
1725
           WRITE_FAN1(soft_pwm_count_fan[1] > pwm_mask ? HIGH : LOW);
1725
           WRITE_FAN1(soft_pwm_count_fan[1] > pwm_mask ? HIGH : LOW);
1726
         #endif
1726
         #endif
1727
         #if HAS_FAN2
1727
         #if HAS_FAN2
1728
-          soft_pwm_count_fan[2] = (soft_pwm_count_fan[2] & pwm_mask) + soft_pwm_amount_fan[2] >> 1;
1728
+          soft_pwm_count_fan[2] = ((soft_pwm_count_fan[2] & pwm_mask) + soft_pwm_amount_fan[2]) >> 1;
1729
           WRITE_FAN2(soft_pwm_count_fan[2] > pwm_mask ? HIGH : LOW);
1729
           WRITE_FAN2(soft_pwm_count_fan[2] > pwm_mask ? HIGH : LOW);
1730
         #endif
1730
         #endif
1731
       #endif
1731
       #endif

Loading…
Cancel
Save