Bläddra i källkod

Merge pull request #6647 from thinkyhead/bf_pwm_cleanup

Rename software PWM variables for clarity
Scott Lahteine 8 år sedan
förälder
incheckning
5402eaf9bd

+ 1
- 1
Marlin/Conditionals_post.h Visa fil

649
   /**
649
   /**
650
    * Heater & Fan Pausing
650
    * Heater & Fan Pausing
651
    */
651
    */
652
-  #if ENABLED(PROBING_FANS_OFF) && FAN_COUNT == 0
652
+  #if FAN_COUNT == 0
653
     #undef PROBING_FANS_OFF
653
     #undef PROBING_FANS_OFF
654
   #endif
654
   #endif
655
   #define QUIET_PROBING (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF))
655
   #define QUIET_PROBING (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF))

+ 22
- 27
Marlin/Marlin_main.cpp Visa fil

2057
 #endif
2057
 #endif
2058
 
2058
 
2059
 #if ENABLED(PROBING_FANS_OFF)
2059
 #if ENABLED(PROBING_FANS_OFF)
2060
-  void fans_pause(bool p) {
2061
-    if (p == fans_paused) { // If called out of order something is wrong
2062
-      SERIAL_ERROR_START;
2063
-      serialprintPGM(fans_paused ? PSTR("Fans already paused!") : PSTR("Fans already unpaused!"));
2064
-      return;
2065
-    }
2066
-
2067
-    if (p)
2068
-      for (uint8_t x = 0;x < FAN_COUNT;x++) {
2069
-        paused_fanSpeeds[x] = fanSpeeds[x];
2070
-        fanSpeeds[x] = 0;
2071
-      }
2072
-    else
2073
-      for (uint8_t x = 0;x < FAN_COUNT;x++)
2074
-        fanSpeeds[x] = paused_fanSpeeds[x];
2075
 
2060
 
2076
-    fans_paused = p;
2061
+  void fans_pause(const bool p) {
2062
+    if (p != fans_paused) {
2063
+      fans_paused = p;
2064
+      if (p)
2065
+        for (uint8_t x = 0; x < FAN_COUNT; x++) {
2066
+          paused_fanSpeeds[x] = fanSpeeds[x];
2067
+          fanSpeeds[x] = 0;
2068
+        }
2069
+      else
2070
+        for (uint8_t x = 0; x < FAN_COUNT; x++)
2071
+          fanSpeeds[x] = paused_fanSpeeds[x];
2072
+    }
2077
   }
2073
   }
2074
+
2078
 #endif // PROBING_FANS_OFF
2075
 #endif // PROBING_FANS_OFF
2079
 
2076
 
2080
 #if HAS_BED_PROBE
2077
 #if HAS_BED_PROBE
2089
   #endif
2086
   #endif
2090
 
2087
 
2091
   #if QUIET_PROBING
2088
   #if QUIET_PROBING
2092
-    void probing_pause(bool pause) {
2089
+    void probing_pause(const bool p) {
2093
       #if ENABLED(PROBING_HEATERS_OFF)
2090
       #if ENABLED(PROBING_HEATERS_OFF)
2094
-        thermalManager.pause(pause);
2091
+        thermalManager.pause(p);
2095
       #endif
2092
       #endif
2096
-
2097
       #if ENABLED(PROBING_FANS_OFF)
2093
       #if ENABLED(PROBING_FANS_OFF)
2098
-        fans_pause(pause);
2094
+        fans_pause(p);
2099
       #endif
2095
       #endif
2100
-
2101
-      if(pause) safe_delay(25);
2096
+      if (p) safe_delay(25);
2102
     }
2097
     }
2103
-  #endif
2098
+  #endif // QUIET_PROBING
2104
 
2099
 
2105
   #if ENABLED(BLTOUCH)
2100
   #if ENABLED(BLTOUCH)
2106
 
2101
 
11141
     // SERIAL_ECHOPAIR(" seconds=", seconds);
11136
     // SERIAL_ECHOPAIR(" seconds=", seconds);
11142
     // SERIAL_ECHOLNPAIR(" segments=", segments);
11137
     // SERIAL_ECHOLNPAIR(" segments=", segments);
11143
 
11138
 
11144
-    #if IS_SCARA
11139
+    #if IS_SCARA && ENABLED(SCARA_FEEDRATE_SCALING)
11145
       // SCARA needs to scale the feed rate from mm/s to degrees/s
11140
       // SCARA needs to scale the feed rate from mm/s to degrees/s
11146
       const float inv_segment_length = min(10.0, float(segments) / cartesian_mm), // 1/mm/segs
11141
       const float inv_segment_length = min(10.0, float(segments) / cartesian_mm), // 1/mm/segs
11147
                   feed_factor = inv_segment_length * _feedrate_mm_s;
11142
                   feed_factor = inv_segment_length * _feedrate_mm_s;
11168
 
11163
 
11169
       ADJUST_DELTA(logical); // Adjust Z if bed leveling is enabled
11164
       ADJUST_DELTA(logical); // Adjust Z if bed leveling is enabled
11170
 
11165
 
11171
-      #if IS_SCARA
11166
+      #if IS_SCARA && ENABLED(SCARA_FEEDRATE_SCALING)
11172
         // For SCARA scale the feed rate from mm/s to degrees/s
11167
         // For SCARA scale the feed rate from mm/s to degrees/s
11173
         // Use ratio between the length of the move and the larger angle change
11168
         // Use ratio between the length of the move and the larger angle change
11174
         const float adiff = abs(delta[A_AXIS] - oldA),
11169
         const float adiff = abs(delta[A_AXIS] - oldA),
11184
     // Since segment_distance is only approximate,
11179
     // Since segment_distance is only approximate,
11185
     // the final move must be to the exact destination.
11180
     // the final move must be to the exact destination.
11186
 
11181
 
11187
-    #if IS_SCARA
11182
+    #if IS_SCARA && ENABLED(SCARA_FEEDRATE_SCALING)
11188
       // For SCARA scale the feed rate from mm/s to degrees/s
11183
       // For SCARA scale the feed rate from mm/s to degrees/s
11189
       // With segments > 1 length is 1 segment, otherwise total length
11184
       // With segments > 1 length is 1 segment, otherwise total length
11190
       inverse_kinematics(ltarget);
11185
       inverse_kinematics(ltarget);
11516
     const millis_t ms = millis();
11511
     const millis_t ms = millis();
11517
     if (ELAPSED(ms, nextMotorCheck)) {
11512
     if (ELAPSED(ms, nextMotorCheck)) {
11518
       nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
11513
       nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
11519
-      if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON || thermalManager.soft_pwm_bed > 0
11514
+      if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON || thermalManager.soft_pwm_amount_bed > 0
11520
           || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled...
11515
           || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled...
11521
           #if E_STEPPERS > 1
11516
           #if E_STEPPERS > 1
11522
             || E1_ENABLE_READ == E_ENABLE_ON
11517
             || E1_ENABLE_READ == E_ENABLE_ON

+ 1
- 0
Marlin/example_configurations/SCARA/Configuration.h Visa fil

76
 
76
 
77
 #if ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)
77
 #if ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)
78
   //#define DEBUG_SCARA_KINEMATICS
78
   //#define DEBUG_SCARA_KINEMATICS
79
+  //#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
79
 
80
 
80
   // If movement is choppy try lowering this value
81
   // If movement is choppy try lowering this value
81
   #define SCARA_SEGMENTS_PER_SECOND 200
82
   #define SCARA_SEGMENTS_PER_SECOND 200

+ 3
- 3
Marlin/planner.cpp Visa fil

491
 
491
 
492
     #if ENABLED(FAN_SOFT_PWM)
492
     #if ENABLED(FAN_SOFT_PWM)
493
       #if HAS_FAN0
493
       #if HAS_FAN0
494
-        thermalManager.fanSpeedSoftPwm[0] = CALC_FAN_SPEED(0);
494
+        thermalManager.soft_pwm_amount_fan[0] = CALC_FAN_SPEED(0);
495
       #endif
495
       #endif
496
       #if HAS_FAN1
496
       #if HAS_FAN1
497
-        thermalManager.fanSpeedSoftPwm[1] = CALC_FAN_SPEED(1);
497
+        thermalManager.soft_pwm_amount_fan[1] = CALC_FAN_SPEED(1);
498
       #endif
498
       #endif
499
       #if HAS_FAN2
499
       #if HAS_FAN2
500
-        thermalManager.fanSpeedSoftPwm[2] = CALC_FAN_SPEED(2);
500
+        thermalManager.soft_pwm_amount_fan[2] = CALC_FAN_SPEED(2);
501
       #endif
501
       #endif
502
     #else
502
     #else
503
       #if HAS_FAN0
503
       #if HAS_FAN0

platformio.ini → Marlin/platformio.ini Visa fil


+ 89
- 100
Marlin/temperature.cpp Visa fil

74
   float Temperature::redundant_temperature = 0.0;
74
   float Temperature::redundant_temperature = 0.0;
75
 #endif
75
 #endif
76
 
76
 
77
-uint8_t Temperature::soft_pwm_bed;
78
-
79
-#if ENABLED(FAN_SOFT_PWM)
80
-  uint8_t Temperature::fanSpeedSoftPwm[FAN_COUNT];
81
-#endif
82
-
83
 #if ENABLED(PIDTEMP)
77
 #if ENABLED(PIDTEMP)
84
   #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
78
   #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
85
     float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
79
     float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
194
   millis_t Temperature::next_auto_fan_check_ms = 0;
188
   millis_t Temperature::next_auto_fan_check_ms = 0;
195
 #endif
189
 #endif
196
 
190
 
197
-uint8_t Temperature::soft_pwm[HOTENDS];
191
+uint8_t Temperature::soft_pwm_amount[HOTENDS],
192
+        Temperature::soft_pwm_amount_bed;
198
 
193
 
199
 #if ENABLED(FAN_SOFT_PWM)
194
 #if ENABLED(FAN_SOFT_PWM)
200
-  uint8_t Temperature::soft_pwm_fan[FAN_COUNT];
195
+  uint8_t Temperature::soft_pwm_amount_fan[FAN_COUNT],
196
+          Temperature::soft_pwm_count_fan[FAN_COUNT];
201
 #endif
197
 #endif
202
 
198
 
203
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
199
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
206
 
202
 
207
 #if ENABLED(PROBING_HEATERS_OFF)
203
 #if ENABLED(PROBING_HEATERS_OFF)
208
   bool Temperature::paused;
204
   bool Temperature::paused;
209
-  int16_t Temperature::paused_hotend_temps[HOTENDS];
205
+  int16_t Temperature::paused_hotend_temp[HOTENDS];
210
   #if HAS_TEMP_BED
206
   #if HAS_TEMP_BED
211
     int16_t Temperature::paused_bed_temp;
207
     int16_t Temperature::paused_bed_temp;
212
   #endif
208
   #endif
254
 
250
 
255
     #if HAS_PID_FOR_BOTH
251
     #if HAS_PID_FOR_BOTH
256
       if (hotend < 0)
252
       if (hotend < 0)
257
-        soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
253
+        soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1;
258
       else
254
       else
259
-        soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
255
+        soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1;
260
     #elif ENABLED(PIDTEMP)
256
     #elif ENABLED(PIDTEMP)
261
-      soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
257
+      soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1;
262
     #else
258
     #else
263
-      soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
259
+      soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1;
264
     #endif
260
     #endif
265
 
261
 
266
     wait_for_heatup = true;
262
     wait_for_heatup = true;
298
             heating = false;
294
             heating = false;
299
             #if HAS_PID_FOR_BOTH
295
             #if HAS_PID_FOR_BOTH
300
               if (hotend < 0)
296
               if (hotend < 0)
301
-                soft_pwm_bed = (bias - d) >> 1;
297
+                soft_pwm_amount_bed = (bias - d) >> 1;
302
               else
298
               else
303
-                soft_pwm[hotend] = (bias - d) >> 1;
299
+                soft_pwm_amount[hotend] = (bias - d) >> 1;
304
             #elif ENABLED(PIDTEMP)
300
             #elif ENABLED(PIDTEMP)
305
-              soft_pwm[hotend] = (bias - d) >> 1;
301
+              soft_pwm_amount[hotend] = (bias - d) >> 1;
306
             #elif ENABLED(PIDTEMPBED)
302
             #elif ENABLED(PIDTEMPBED)
307
-              soft_pwm_bed = (bias - d) >> 1;
303
+              soft_pwm_amount_bed = (bias - d) >> 1;
308
             #endif
304
             #endif
309
             t1 = ms;
305
             t1 = ms;
310
             t_high = t1 - t2;
306
             t_high = t1 - t2;
367
             }
363
             }
368
             #if HAS_PID_FOR_BOTH
364
             #if HAS_PID_FOR_BOTH
369
               if (hotend < 0)
365
               if (hotend < 0)
370
-                soft_pwm_bed = (bias + d) >> 1;
366
+                soft_pwm_amount_bed = (bias + d) >> 1;
371
               else
367
               else
372
-                soft_pwm[hotend] = (bias + d) >> 1;
368
+                soft_pwm_amount[hotend] = (bias + d) >> 1;
373
             #elif ENABLED(PIDTEMP)
369
             #elif ENABLED(PIDTEMP)
374
-              soft_pwm[hotend] = (bias + d) >> 1;
370
+              soft_pwm_amount[hotend] = (bias + d) >> 1;
375
             #else
371
             #else
376
-              soft_pwm_bed = (bias + d) >> 1;
372
+              soft_pwm_amount_bed = (bias + d) >> 1;
377
             #endif
373
             #endif
378
             cycles++;
374
             cycles++;
379
             min = temp;
375
             min = temp;
466
 }
462
 }
467
 
463
 
468
 int Temperature::getHeaterPower(int heater) {
464
 int Temperature::getHeaterPower(int heater) {
469
-  return heater < 0 ? soft_pwm_bed : soft_pwm[heater];
465
+  return heater < 0 ? soft_pwm_amount_bed : soft_pwm_amount[heater];
470
 }
466
 }
471
 
467
 
472
 #if HAS_AUTO_FAN
468
 #if HAS_AUTO_FAN
717
     float pid_output = get_pid_output(e);
713
     float pid_output = get_pid_output(e);
718
 
714
 
719
     // Check if temperature is within the correct range
715
     // Check if temperature is within the correct range
720
-    soft_pwm[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
716
+    soft_pwm_amount[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
721
 
717
 
722
     // Check if the temperature is failing to increase
718
     // Check if the temperature is failing to increase
723
     #if WATCH_HOTENDS
719
     #if WATCH_HOTENDS
798
     #if ENABLED(PIDTEMPBED)
794
     #if ENABLED(PIDTEMPBED)
799
       float pid_output = get_pid_output_bed();
795
       float pid_output = get_pid_output_bed();
800
 
796
 
801
-      soft_pwm_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)pid_output >> 1 : 0;
797
+      soft_pwm_amount_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)pid_output >> 1 : 0;
802
 
798
 
803
     #elif ENABLED(BED_LIMIT_SWITCHING)
799
     #elif ENABLED(BED_LIMIT_SWITCHING)
804
       // Check if temperature is within the correct band
800
       // Check if temperature is within the correct band
805
       if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) {
801
       if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) {
806
         if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
802
         if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
807
-          soft_pwm_bed = 0;
803
+          soft_pwm_amount_bed = 0;
808
         else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS))
804
         else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS))
809
-          soft_pwm_bed = MAX_BED_POWER >> 1;
805
+          soft_pwm_amount_bed = MAX_BED_POWER >> 1;
810
       }
806
       }
811
       else {
807
       else {
812
-        soft_pwm_bed = 0;
808
+        soft_pwm_amount_bed = 0;
813
         WRITE_HEATER_BED(LOW);
809
         WRITE_HEATER_BED(LOW);
814
       }
810
       }
815
     #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING
811
     #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING
816
       // Check if temperature is within the correct range
812
       // Check if temperature is within the correct range
817
       if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) {
813
       if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) {
818
-        soft_pwm_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0;
814
+        soft_pwm_amount_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0;
819
       }
815
       }
820
       else {
816
       else {
821
-        soft_pwm_bed = 0;
817
+        soft_pwm_amount_bed = 0;
822
         WRITE_HEATER_BED(LOW);
818
         WRITE_HEATER_BED(LOW);
823
       }
819
       }
824
     #endif
820
     #endif
1205
 
1201
 
1206
   #if ENABLED(PROBING_HEATERS_OFF)
1202
   #if ENABLED(PROBING_HEATERS_OFF)
1207
     paused = false;
1203
     paused = false;
1208
-    ZERO(paused_hotend_temps);
1204
+    ZERO(paused_hotend_temp);
1209
     #if HAS_TEMP_BED
1205
     #if HAS_TEMP_BED
1210
       paused_bed_temp = 0;
1206
       paused_bed_temp = 0;
1211
     #endif
1207
     #endif
1316
   // Unpause and reset everything
1312
   // Unpause and reset everything
1317
   #if ENABLED(PROBING_HEATERS_OFF)
1313
   #if ENABLED(PROBING_HEATERS_OFF)
1318
     paused = false;
1314
     paused = false;
1319
-    ZERO(paused_hotend_temps);
1315
+    ZERO(paused_hotend_temp);
1320
     #if HAS_TEMP_BED
1316
     #if HAS_TEMP_BED
1321
       paused_bed_temp = 0;
1317
       paused_bed_temp = 0;
1322
     #endif
1318
     #endif
1327
 
1323
 
1328
   #define DISABLE_HEATER(NR) { \
1324
   #define DISABLE_HEATER(NR) { \
1329
     setTargetHotend(0, NR); \
1325
     setTargetHotend(0, NR); \
1330
-    soft_pwm[NR] = 0; \
1326
+    soft_pwm_amount[NR] = 0; \
1331
     WRITE_HEATER_ ##NR (LOW); \
1327
     WRITE_HEATER_ ##NR (LOW); \
1332
   }
1328
   }
1333
 
1329
 
1349
 
1345
 
1350
   #if HAS_TEMP_BED
1346
   #if HAS_TEMP_BED
1351
     target_temperature_bed = 0;
1347
     target_temperature_bed = 0;
1352
-    soft_pwm_bed = 0;
1348
+    soft_pwm_amount_bed = 0;
1353
     #if HAS_HEATER_BED
1349
     #if HAS_HEATER_BED
1354
       WRITE_HEATER_BED(LOW);
1350
       WRITE_HEATER_BED(LOW);
1355
     #endif
1351
     #endif
1357
 }
1353
 }
1358
 
1354
 
1359
 #if ENABLED(PROBING_HEATERS_OFF)
1355
 #if ENABLED(PROBING_HEATERS_OFF)
1360
-  void Temperature::pause(bool p) {
1361
-    if (p == paused) { // If called out of order something is wrong
1362
-      SERIAL_ERROR_START;
1363
-      serialprintPGM(paused ? PSTR("Heaters already paused!") : PSTR("Heaters already unpaused!"));
1364
-      return;
1365
-    }
1366
 
1356
 
1367
-    if (p) {
1368
-      HOTEND_LOOP() {
1369
-        paused_hotend_temps[e] = degTargetHotend(e);
1370
-        setTargetHotend(0, e);
1357
+  void Temperature::pause(const bool p) {
1358
+    if (p != paused) {
1359
+      paused = p;
1360
+      if (p) {
1361
+        HOTEND_LOOP() {
1362
+          paused_hotend_temp[e] = degTargetHotend(e);
1363
+          setTargetHotend(0, e);
1364
+        }
1365
+        #if HAS_TEMP_BED
1366
+          paused_bed_temp = degTargetBed();
1367
+          setTargetBed(0);
1368
+        #endif
1369
+      }
1370
+      else {
1371
+        HOTEND_LOOP() setTargetHotend(paused_hotend_temp[e], e);
1372
+        #if HAS_TEMP_BED
1373
+          setTargetBed(paused_bed_temp);
1374
+        #endif
1371
       }
1375
       }
1372
-      #if HAS_TEMP_BED
1373
-        paused_bed_temp = degTargetBed();
1374
-        setTargetBed(0);
1375
-      #endif
1376
-    }
1377
-    else {
1378
-      HOTEND_LOOP() setTargetHotend(paused_hotend_temps[e], e);
1379
-      #if HAS_TEMP_BED
1380
-        setTargetBed(paused_bed_temp);
1381
-      #endif
1382
     }
1376
     }
1383
-
1384
-    paused = p;
1385
   }
1377
   }
1386
 
1378
 
1387
-  bool Temperature::ispaused() {
1388
-    return paused;
1389
-  }
1390
 #endif // PROBING_HEATERS_OFF
1379
 #endif // PROBING_HEATERS_OFF
1391
 
1380
 
1392
 #if ENABLED(HEATER_0_USES_MAX6675)
1381
 #if ENABLED(HEATER_0_USES_MAX6675)
1613
   #if ENABLED(SLOW_PWM_HEATERS)
1602
   #if ENABLED(SLOW_PWM_HEATERS)
1614
     static uint8_t slow_pwm_count = 0;
1603
     static uint8_t slow_pwm_count = 0;
1615
     #define ISR_STATICS(n) \
1604
     #define ISR_STATICS(n) \
1616
-      static uint8_t soft_pwm_ ## n; \
1617
-      static uint8_t state_heater_ ## n = 0; \
1618
-      static uint8_t state_timer_heater_ ## n = 0
1605
+      static uint8_t soft_pwm_count_ ## n, \
1606
+                     state_heater_ ## n = 0, \
1607
+                     state_timer_heater_ ## n = 0
1619
   #else
1608
   #else
1620
-    #define ISR_STATICS(n) static uint8_t soft_pwm_ ## n = 0
1609
+    #define ISR_STATICS(n) static uint8_t soft_pwm_count_ ## n = 0
1621
   #endif
1610
   #endif
1622
 
1611
 
1623
   // Statics per heater
1612
   // Statics per heater
1656
      */
1645
      */
1657
     if (pwm_count_tmp >= 127) {
1646
     if (pwm_count_tmp >= 127) {
1658
       pwm_count_tmp -= 127;
1647
       pwm_count_tmp -= 127;
1659
-      soft_pwm_0 = (soft_pwm_0 & pwm_mask) + soft_pwm[0];
1660
-      WRITE_HEATER_0(soft_pwm_0 > pwm_mask ? HIGH : LOW);
1648
+      soft_pwm_count_0 = (soft_pwm_count_0 & pwm_mask) + soft_pwm_amount[0];
1649
+      WRITE_HEATER_0(soft_pwm_count_0 > pwm_mask ? HIGH : LOW);
1661
       #if HOTENDS > 1
1650
       #if HOTENDS > 1
1662
-        soft_pwm_1 = (soft_pwm_1 & pwm_mask) + soft_pwm[1];
1663
-        WRITE_HEATER_1(soft_pwm_1 > pwm_mask ? HIGH : LOW);
1651
+        soft_pwm_count_1 = (soft_pwm_count_1 & pwm_mask) + soft_pwm_amount[1];
1652
+        WRITE_HEATER_1(soft_pwm_count_1 > pwm_mask ? HIGH : LOW);
1664
         #if HOTENDS > 2
1653
         #if HOTENDS > 2
1665
-          soft_pwm_2 = (soft_pwm_2 & pwm_mask) + soft_pwm[2];
1666
-          WRITE_HEATER_2(soft_pwm_2 > pwm_mask ? HIGH : LOW);
1654
+          soft_pwm_count_2 = (soft_pwm_count_2 & pwm_mask) + soft_pwm_amount[2];
1655
+          WRITE_HEATER_2(soft_pwm_count_2 > pwm_mask ? HIGH : LOW);
1667
           #if HOTENDS > 3
1656
           #if HOTENDS > 3
1668
-            soft_pwm_3 = (soft_pwm_3 & pwm_mask) + soft_pwm[3];
1669
-            WRITE_HEATER_3(soft_pwm_3 > pwm_mask ? HIGH : LOW);
1657
+            soft_pwm_count_3 = (soft_pwm_count_3 & pwm_mask) + soft_pwm_amount[3];
1658
+            WRITE_HEATER_3(soft_pwm_count_3 > pwm_mask ? HIGH : LOW);
1670
             #if HOTENDS > 4
1659
             #if HOTENDS > 4
1671
-              soft_pwm_4 = (soft_pwm_4 & pwm_mask) + soft_pwm[4];
1672
-              WRITE_HEATER_4(soft_pwm_4 > pwm_mask ? HIGH : LOW);
1660
+              soft_pwm_count_4 = (soft_pwm_count_4 & pwm_mask) + soft_pwm_amount[4];
1661
+              WRITE_HEATER_4(soft_pwm_count_4 > pwm_mask ? HIGH : LOW);
1673
             #endif // HOTENDS > 4
1662
             #endif // HOTENDS > 4
1674
           #endif // HOTENDS > 3
1663
           #endif // HOTENDS > 3
1675
         #endif // HOTENDS > 2
1664
         #endif // HOTENDS > 2
1676
       #endif // HOTENDS > 1
1665
       #endif // HOTENDS > 1
1677
 
1666
 
1678
       #if HAS_HEATER_BED
1667
       #if HAS_HEATER_BED
1679
-        soft_pwm_BED = (soft_pwm_BED & pwm_mask) + soft_pwm_bed;
1680
-        WRITE_HEATER_BED(soft_pwm_BED > pwm_mask ? HIGH : LOW);
1668
+        soft_pwm_count_BED = (soft_pwm_count_BED & pwm_mask) + soft_pwm_amount_bed;
1669
+        WRITE_HEATER_BED(soft_pwm_count_BED > pwm_mask ? HIGH : LOW);
1681
       #endif
1670
       #endif
1682
 
1671
 
1683
       #if ENABLED(FAN_SOFT_PWM)
1672
       #if ENABLED(FAN_SOFT_PWM)
1684
         #if HAS_FAN0
1673
         #if HAS_FAN0
1685
-          soft_pwm_fan[0] = (soft_pwm_fan[0] & pwm_mask) + fanSpeedSoftPwm[0] >> 1;
1686
-          WRITE_FAN(soft_pwm_fan[0] > pwm_mask ? HIGH : LOW);
1674
+          soft_pwm_count_fan[0] = (soft_pwm_count_fan[0] & pwm_mask) + soft_pwm_amount_fan[0] >> 1;
1675
+          WRITE_FAN(soft_pwm_count_fan[0] > pwm_mask ? HIGH : LOW);
1687
         #endif
1676
         #endif
1688
         #if HAS_FAN1
1677
         #if HAS_FAN1
1689
-          soft_pwm_fan[1] = (soft_pwm_fan[1] & pwm_mask) + fanSpeedSoftPwm[1] >> 1;
1690
-          WRITE_FAN1(soft_pwm_fan[1] > pwm_mask ? HIGH : LOW);
1678
+          soft_pwm_count_fan[1] = (soft_pwm_count_fan[1] & pwm_mask) + soft_pwm_amount_fan[1] >> 1;
1679
+          WRITE_FAN1(soft_pwm_count_fan[1] > pwm_mask ? HIGH : LOW);
1691
         #endif
1680
         #endif
1692
         #if HAS_FAN2
1681
         #if HAS_FAN2
1693
-          soft_pwm_fan[2] = (soft_pwm_fan[2] & pwm_mask) + fanSpeedSoftPwm[2] >> 1;
1694
-          WRITE_FAN2(soft_pwm_fan[2] > pwm_mask ? HIGH : LOW);
1682
+          soft_pwm_count_fan[2] = (soft_pwm_count_fan[2] & pwm_mask) + soft_pwm_amount_fan[2] >> 1;
1683
+          WRITE_FAN2(soft_pwm_count_fan[2] > pwm_mask ? HIGH : LOW);
1695
         #endif
1684
         #endif
1696
       #endif
1685
       #endif
1697
     }
1686
     }
1698
     else {
1687
     else {
1699
-      if (soft_pwm_0 <= pwm_count_tmp) WRITE_HEATER_0(0);
1688
+      if (soft_pwm_count_0 <= pwm_count_tmp) WRITE_HEATER_0(0);
1700
       #if HOTENDS > 1
1689
       #if HOTENDS > 1
1701
-        if (soft_pwm_1 <= pwm_count_tmp) WRITE_HEATER_1(0);
1690
+        if (soft_pwm_count_1 <= pwm_count_tmp) WRITE_HEATER_1(0);
1702
         #if HOTENDS > 2
1691
         #if HOTENDS > 2
1703
-          if (soft_pwm_2 <= pwm_count_tmp) WRITE_HEATER_2(0);
1692
+          if (soft_pwm_count_2 <= pwm_count_tmp) WRITE_HEATER_2(0);
1704
           #if HOTENDS > 3
1693
           #if HOTENDS > 3
1705
-            if (soft_pwm_3 <= pwm_count_tmp) WRITE_HEATER_3(0);
1694
+            if (soft_pwm_count_3 <= pwm_count_tmp) WRITE_HEATER_3(0);
1706
             #if HOTENDS > 4
1695
             #if HOTENDS > 4
1707
-              if (soft_pwm_4 <= pwm_count_tmp) WRITE_HEATER_4(0);
1696
+              if (soft_pwm_count_4 <= pwm_count_tmp) WRITE_HEATER_4(0);
1708
             #endif // HOTENDS > 4
1697
             #endif // HOTENDS > 4
1709
           #endif // HOTENDS > 3
1698
           #endif // HOTENDS > 3
1710
         #endif // HOTENDS > 2
1699
         #endif // HOTENDS > 2
1711
       #endif // HOTENDS > 1
1700
       #endif // HOTENDS > 1
1712
 
1701
 
1713
       #if HAS_HEATER_BED
1702
       #if HAS_HEATER_BED
1714
-        if (soft_pwm_BED <= pwm_count_tmp) WRITE_HEATER_BED(0);
1703
+        if (soft_pwm_count_BED <= pwm_count_tmp) WRITE_HEATER_BED(0);
1715
       #endif
1704
       #endif
1716
 
1705
 
1717
       #if ENABLED(FAN_SOFT_PWM)
1706
       #if ENABLED(FAN_SOFT_PWM)
1718
         #if HAS_FAN0
1707
         #if HAS_FAN0
1719
-          if (soft_pwm_fan[0] <= pwm_count_tmp) WRITE_FAN(0);
1708
+          if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(0);
1720
         #endif
1709
         #endif
1721
         #if HAS_FAN1
1710
         #if HAS_FAN1
1722
-          if (soft_pwm_fan[1] <= pwm_count_tmp) WRITE_FAN1(0);
1711
+          if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN1(0);
1723
         #endif
1712
         #endif
1724
         #if HAS_FAN2
1713
         #if HAS_FAN2
1725
-          if (soft_pwm_fan[2] <= pwm_count_tmp) WRITE_FAN2(0);
1714
+          if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN2(0);
1726
         #endif
1715
         #endif
1727
       #endif
1716
       #endif
1728
     }
1717
     }
1765
           WRITE_HEATER_ ##NR(0); \
1754
           WRITE_HEATER_ ##NR(0); \
1766
         } \
1755
         } \
1767
       }
1756
       }
1768
-    #define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm[n])
1757
+    #define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n])
1769
 
1758
 
1770
     #define PWM_OFF_ROUTINE(NR) \
1759
     #define PWM_OFF_ROUTINE(NR) \
1771
       if (soft_pwm_ ##NR < slow_pwm_count) { \
1760
       if (soft_pwm_ ##NR < slow_pwm_count) { \
1792
         #endif // HOTENDS > 2
1781
         #endif // HOTENDS > 2
1793
       #endif // HOTENDS > 1
1782
       #endif // HOTENDS > 1
1794
       #if HAS_HEATER_BED
1783
       #if HAS_HEATER_BED
1795
-        _SLOW_PWM_ROUTINE(BED, soft_pwm_bed); // BED
1784
+        _SLOW_PWM_ROUTINE(BED, soft_pwm_amount_bed); // BED
1796
       #endif
1785
       #endif
1797
 
1786
 
1798
     } // slow_pwm_count == 0
1787
     } // slow_pwm_count == 0
1818
       if (pwm_count_tmp >= 127) {
1807
       if (pwm_count_tmp >= 127) {
1819
         pwm_count_tmp = 0;
1808
         pwm_count_tmp = 0;
1820
         #if HAS_FAN0
1809
         #if HAS_FAN0
1821
-          soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
1822
-          WRITE_FAN(soft_pwm_fan[0] > 0 ? HIGH : LOW);
1810
+          soft_pwm_count_fan[0] = soft_pwm_amount_fan[0] >> 1;
1811
+          WRITE_FAN(soft_pwm_count_fan[0] > 0 ? HIGH : LOW);
1823
         #endif
1812
         #endif
1824
         #if HAS_FAN1
1813
         #if HAS_FAN1
1825
-          soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
1826
-          WRITE_FAN1(soft_pwm_fan[1] > 0 ? HIGH : LOW);
1814
+          soft_pwm_count_fan[1] = soft_pwm_amount_fan[1] >> 1;
1815
+          WRITE_FAN1(soft_pwm_count_fan[1] > 0 ? HIGH : LOW);
1827
         #endif
1816
         #endif
1828
         #if HAS_FAN2
1817
         #if HAS_FAN2
1829
-          soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
1830
-          WRITE_FAN2(soft_pwm_fan[2] > 0 ? HIGH : LOW);
1818
+          soft_pwm_count_fan[2] = soft_pwm_amount_fan[2] >> 1;
1819
+          WRITE_FAN2(soft_pwm_count_fan[2] > 0 ? HIGH : LOW);
1831
         #endif
1820
         #endif
1832
       }
1821
       }
1833
       #if HAS_FAN0
1822
       #if HAS_FAN0
1834
-        if (soft_pwm_fan[0] <= pwm_count_tmp) WRITE_FAN(0);
1823
+        if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(0);
1835
       #endif
1824
       #endif
1836
       #if HAS_FAN1
1825
       #if HAS_FAN1
1837
-        if (soft_pwm_fan[1] <= pwm_count_tmp) WRITE_FAN1(0);
1826
+        if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN1(0);
1838
       #endif
1827
       #endif
1839
       #if HAS_FAN2
1828
       #if HAS_FAN2
1840
-        if (soft_pwm_fan[2] <= pwm_count_tmp) WRITE_FAN2(0);
1829
+        if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN2(0);
1841
       #endif
1830
       #endif
1842
     #endif // FAN_SOFT_PWM
1831
     #endif // FAN_SOFT_PWM
1843
 
1832
 

+ 6
- 11
Marlin/temperature.h Visa fil

109
       static float redundant_temperature;
109
       static float redundant_temperature;
110
     #endif
110
     #endif
111
 
111
 
112
-    static uint8_t soft_pwm_bed;
112
+    static uint8_t soft_pwm_amount[HOTENDS],
113
+                   soft_pwm_amount_bed;
113
 
114
 
114
     #if ENABLED(FAN_SOFT_PWM)
115
     #if ENABLED(FAN_SOFT_PWM)
115
-      static uint8_t fanSpeedSoftPwm[FAN_COUNT];
116
+      static uint8_t soft_pwm_amount_fan[FAN_COUNT],
117
+                     soft_pwm_count_fan[FAN_COUNT];
116
     #endif
118
     #endif
117
 
119
 
118
     #if ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)
120
     #if ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)
249
       static millis_t next_auto_fan_check_ms;
251
       static millis_t next_auto_fan_check_ms;
250
     #endif
252
     #endif
251
 
253
 
252
-    static uint8_t soft_pwm[HOTENDS];
253
-
254
-    #if ENABLED(FAN_SOFT_PWM)
255
-      static uint8_t soft_pwm_fan[FAN_COUNT];
256
-    #endif
257
-
258
     #if ENABLED(FILAMENT_WIDTH_SENSOR)
254
     #if ENABLED(FILAMENT_WIDTH_SENSOR)
259
       static int current_raw_filwidth;  //Holds measured filament diameter - one extruder only
255
       static int current_raw_filwidth;  //Holds measured filament diameter - one extruder only
260
     #endif
256
     #endif
261
 
257
 
262
     #if ENABLED(PROBING_HEATERS_OFF)
258
     #if ENABLED(PROBING_HEATERS_OFF)
263
       static bool paused;
259
       static bool paused;
264
-      static int16_t paused_hotend_temps[HOTENDS];
260
+      static int16_t paused_hotend_temp[HOTENDS];
265
 
261
 
266
       #if HAS_TEMP_BED
262
       #if HAS_TEMP_BED
267
         static int16_t paused_bed_temp;
263
         static int16_t paused_bed_temp;
462
     #endif // BABYSTEPPING
458
     #endif // BABYSTEPPING
463
 
459
 
464
     #if ENABLED(PROBING_HEATERS_OFF)
460
     #if ENABLED(PROBING_HEATERS_OFF)
465
-      static void pause(bool p);
466
-      static bool ispaused();
461
+      static void pause(const bool p);
467
     #endif
462
     #endif
468
 
463
 
469
   private:
464
   private:

+ 1
- 1
Marlin/ubl_G29.cpp Visa fil

1006
     if (!ubl.state.active) SERIAL_PROTOCOLPGM("de");
1006
     if (!ubl.state.active) SERIAL_PROTOCOLPGM("de");
1007
     SERIAL_PROTOCOLLNPGM("activated.\n");
1007
     SERIAL_PROTOCOLLNPGM("activated.\n");
1008
   }
1008
   }
1009
- 
1009
+
1010
   bool g29_parameter_parsing() {
1010
   bool g29_parameter_parsing() {
1011
     bool err_flag = false;
1011
     bool err_flag = false;
1012
 
1012
 

+ 1
- 1
Marlin/ubl_motion.cpp Visa fil

225
     const float e_normalized_dist = e_position / on_axis_distance,
225
     const float e_normalized_dist = e_position / on_axis_distance,
226
                 z_normalized_dist = z_position / on_axis_distance;
226
                 z_normalized_dist = z_position / on_axis_distance;
227
 
227
 
228
-    int current_xi = cell_start_xi, 
228
+    int current_xi = cell_start_xi,
229
         current_yi = cell_start_yi;
229
         current_yi = cell_start_yi;
230
 
230
 
231
     const float m = dy / dx,
231
     const float m = dy / dx,

+ 29
- 29
README.md Visa fil

113
 ## Credits
113
 ## Credits
114
 
114
 
115
 The current Marlin dev team consists of:
115
 The current Marlin dev team consists of:
116
- - Roxanne Neufeld [@Roxy-3D] - English
117
- - Scott Lahteine [@thinkyhead] - English
118
- - Bob Kuhn [@Bob-the-Kuhn] - English
119
- - Andreas Hardtung [@AnHardt] - Deutsch, English
120
- - Nico Tonnhofer [@Wurstnase] - Deutsch, English
121
- - Jochen Groppe [@CONSULitAS] - Deutsch, English
122
- - João Brazio [@jbrazio] - Portuguese, English
123
- - Bo Hermannsen [@boelle] - Danish, English
124
- - Bob Cousins [@bobc] - English
125
- - [@maverikou]
126
- - Chris Palmer [@nophead]
127
- - [@paclema]
128
- - Erik van der Zalm [@ErikZalm]
129
- - David Braam [@daid]
130
- - Bernhard Kubicek [@bkubicek]
116
+ - Roxanne Neufeld [[@Roxy-3D](https://github.com/Roxy-3D)] - English
117
+ - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - English
118
+ - Bob Kuhn [[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)] - English
119
+ - Andreas Hardtung [[@AnHardt](https://github.com/AnHardt)] - Deutsch, English
120
+ - Nico Tonnhofer [[@Wurstnase](https://github.com/Wurstnase)] - Deutsch, English
121
+ - Jochen Groppe [[@CONSULitAS](https://github.com/CONSULitAS)] - Deutsch, English
122
+ - João Brazio [[@jbrazio](https://github.com/jbrazio)] - Portuguese, English
123
+ - Bo Hermannsen [[@boelle](https://github.com/boelle)] - Danish, English
124
+ - Bob Cousins [[@bobc](https://github.com/bobc)] - English
125
+ - [[@maverikou](https://github.com/maverikou)]
126
+ - Chris Palmer [[@nophead](https://github.com/nophead)]
127
+ - [[@paclema](https://github.com/paclema)]
128
+ - Erik van der Zalm [[@ErikZalm](https://github.com/ErikZalm)]
129
+ - David Braam [[@daid](https://github.com/daid)]
130
+ - Bernhard Kubicek [[@bkubicek](https://github.com/bkubicek)]
131
 
131
 
132
 More features have been added by:
132
 More features have been added by:
133
- - Alberto Cotronei [@MagoKimbra] - English, Italian
134
- - Thomas Moore [@tcm0116]
135
- - Ernesto Martinez [@emartinez167]
136
- - Petr Zahradnik [@clexpert]
137
- - Kai [@Kaibob2]
138
- - Edward Patel [@epatel]
139
- - F. Malpartida [@fmalpartida] - English, Spanish
140
- - [@esenapaj] - English, Japanese
141
- - [@benlye]
142
- - [@Tannoo]
143
- - [@teemuatlut]
144
- - [@bgort]
145
- - [@LVD-AC]
146
- - [@paulusjacobus]
133
+ - Alberto Cotronei [[@MagoKimbra](https://github.com/MagoKimbra)] - English, Italian
134
+ - Thomas Moore [[@tcm0116](https://github.com/tcm0116)]
135
+ - Ernesto Martinez [[@emartinez167](https://github.com/emartinez167)]
136
+ - Petr Zahradnik [[@clexpert](https://github.com/clexpert)]
137
+ - Kai [[@Kaibob2](https://github.com/Kaibob2)]
138
+ - Edward Patel [[@epatel](https://github.com/epatel)]
139
+ - F. Malpartida [[@fmalpartida](https://github.com/fmalpartida)] - English, Spanish
140
+ - [[@esenapaj](https://github.com/esenapaj)] - English, Japanese
141
+ - [[@benlye](https://github.com/benlye)]
142
+ - [[@Tannoo](https://github.com/Tannoo)]
143
+ - [[@teemuatlut](https://github.com/teemuatlut)]
144
+ - [[@bgort](https://github.com/bgort)]
145
+ - [[@LVD-AC](https://github.com/LVD-AC)]
146
+ - [[@paulusjacobus](https://github.com/paulusjacobus)]
147
  - ...and many others
147
  - ...and many others
148
 
148
 
149
 ## License
149
 ## License

Laddar…
Avbryt
Spara