소스 검색

Merge pull request #6647 from thinkyhead/bf_pwm_cleanup

Rename software PWM variables for clarity
Scott Lahteine 8 년 전
부모
커밋
5402eaf9bd
10개의 변경된 파일153개의 추가작업 그리고 173개의 파일을 삭제
  1. 1
    1
      Marlin/Conditionals_post.h
  2. 22
    27
      Marlin/Marlin_main.cpp
  3. 1
    0
      Marlin/example_configurations/SCARA/Configuration.h
  4. 3
    3
      Marlin/planner.cpp
  5. 0
    0
      Marlin/platformio.ini
  6. 89
    100
      Marlin/temperature.cpp
  7. 6
    11
      Marlin/temperature.h
  8. 1
    1
      Marlin/ubl_G29.cpp
  9. 1
    1
      Marlin/ubl_motion.cpp
  10. 29
    29
      README.md

+ 1
- 1
Marlin/Conditionals_post.h 파일 보기

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

+ 22
- 27
Marlin/Marlin_main.cpp 파일 보기

@@ -2057,24 +2057,21 @@ static void clean_up_after_endstop_or_probe_move() {
2057 2057
 #endif
2058 2058
 
2059 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 2075
 #endif // PROBING_FANS_OFF
2079 2076
 
2080 2077
 #if HAS_BED_PROBE
@@ -2089,18 +2086,16 @@ static void clean_up_after_endstop_or_probe_move() {
2089 2086
   #endif
2090 2087
 
2091 2088
   #if QUIET_PROBING
2092
-    void probing_pause(bool pause) {
2089
+    void probing_pause(const bool p) {
2093 2090
       #if ENABLED(PROBING_HEATERS_OFF)
2094
-        thermalManager.pause(pause);
2091
+        thermalManager.pause(p);
2095 2092
       #endif
2096
-
2097 2093
       #if ENABLED(PROBING_FANS_OFF)
2098
-        fans_pause(pause);
2094
+        fans_pause(p);
2099 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 2100
   #if ENABLED(BLTOUCH)
2106 2101
 
@@ -11141,7 +11136,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
11141 11136
     // SERIAL_ECHOPAIR(" seconds=", seconds);
11142 11137
     // SERIAL_ECHOLNPAIR(" segments=", segments);
11143 11138
 
11144
-    #if IS_SCARA
11139
+    #if IS_SCARA && ENABLED(SCARA_FEEDRATE_SCALING)
11145 11140
       // SCARA needs to scale the feed rate from mm/s to degrees/s
11146 11141
       const float inv_segment_length = min(10.0, float(segments) / cartesian_mm), // 1/mm/segs
11147 11142
                   feed_factor = inv_segment_length * _feedrate_mm_s;
@@ -11168,7 +11163,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
11168 11163
 
11169 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 11167
         // For SCARA scale the feed rate from mm/s to degrees/s
11173 11168
         // Use ratio between the length of the move and the larger angle change
11174 11169
         const float adiff = abs(delta[A_AXIS] - oldA),
@@ -11184,7 +11179,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
11184 11179
     // Since segment_distance is only approximate,
11185 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 11183
       // For SCARA scale the feed rate from mm/s to degrees/s
11189 11184
       // With segments > 1 length is 1 segment, otherwise total length
11190 11185
       inverse_kinematics(ltarget);
@@ -11516,7 +11511,7 @@ void prepare_move_to_destination() {
11516 11511
     const millis_t ms = millis();
11517 11512
     if (ELAPSED(ms, nextMotorCheck)) {
11518 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 11515
           || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled...
11521 11516
           #if E_STEPPERS > 1
11522 11517
             || E1_ENABLE_READ == E_ENABLE_ON

+ 1
- 0
Marlin/example_configurations/SCARA/Configuration.h 파일 보기

@@ -76,6 +76,7 @@
76 76
 
77 77
 #if ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)
78 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 81
   // If movement is choppy try lowering this value
81 82
   #define SCARA_SEGMENTS_PER_SECOND 200

+ 3
- 3
Marlin/planner.cpp 파일 보기

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

platformio.ini → Marlin/platformio.ini 파일 보기


+ 89
- 100
Marlin/temperature.cpp 파일 보기

@@ -74,12 +74,6 @@ int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
74 74
   float Temperature::redundant_temperature = 0.0;
75 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 77
 #if ENABLED(PIDTEMP)
84 78
   #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
85 79
     float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
@@ -194,10 +188,12 @@ int16_t Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TE
194 188
   millis_t Temperature::next_auto_fan_check_ms = 0;
195 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 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 197
 #endif
202 198
 
203 199
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
@@ -206,7 +202,7 @@ uint8_t Temperature::soft_pwm[HOTENDS];
206 202
 
207 203
 #if ENABLED(PROBING_HEATERS_OFF)
208 204
   bool Temperature::paused;
209
-  int16_t Temperature::paused_hotend_temps[HOTENDS];
205
+  int16_t Temperature::paused_hotend_temp[HOTENDS];
210 206
   #if HAS_TEMP_BED
211 207
     int16_t Temperature::paused_bed_temp;
212 208
   #endif
@@ -254,13 +250,13 @@ uint8_t Temperature::soft_pwm[HOTENDS];
254 250
 
255 251
     #if HAS_PID_FOR_BOTH
256 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 254
       else
259
-        soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
255
+        soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1;
260 256
     #elif ENABLED(PIDTEMP)
261
-      soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
257
+      soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1;
262 258
     #else
263
-      soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
259
+      soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1;
264 260
     #endif
265 261
 
266 262
     wait_for_heatup = true;
@@ -298,13 +294,13 @@ uint8_t Temperature::soft_pwm[HOTENDS];
298 294
             heating = false;
299 295
             #if HAS_PID_FOR_BOTH
300 296
               if (hotend < 0)
301
-                soft_pwm_bed = (bias - d) >> 1;
297
+                soft_pwm_amount_bed = (bias - d) >> 1;
302 298
               else
303
-                soft_pwm[hotend] = (bias - d) >> 1;
299
+                soft_pwm_amount[hotend] = (bias - d) >> 1;
304 300
             #elif ENABLED(PIDTEMP)
305
-              soft_pwm[hotend] = (bias - d) >> 1;
301
+              soft_pwm_amount[hotend] = (bias - d) >> 1;
306 302
             #elif ENABLED(PIDTEMPBED)
307
-              soft_pwm_bed = (bias - d) >> 1;
303
+              soft_pwm_amount_bed = (bias - d) >> 1;
308 304
             #endif
309 305
             t1 = ms;
310 306
             t_high = t1 - t2;
@@ -367,13 +363,13 @@ uint8_t Temperature::soft_pwm[HOTENDS];
367 363
             }
368 364
             #if HAS_PID_FOR_BOTH
369 365
               if (hotend < 0)
370
-                soft_pwm_bed = (bias + d) >> 1;
366
+                soft_pwm_amount_bed = (bias + d) >> 1;
371 367
               else
372
-                soft_pwm[hotend] = (bias + d) >> 1;
368
+                soft_pwm_amount[hotend] = (bias + d) >> 1;
373 369
             #elif ENABLED(PIDTEMP)
374
-              soft_pwm[hotend] = (bias + d) >> 1;
370
+              soft_pwm_amount[hotend] = (bias + d) >> 1;
375 371
             #else
376
-              soft_pwm_bed = (bias + d) >> 1;
372
+              soft_pwm_amount_bed = (bias + d) >> 1;
377 373
             #endif
378 374
             cycles++;
379 375
             min = temp;
@@ -466,7 +462,7 @@ void Temperature::updatePID() {
466 462
 }
467 463
 
468 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 468
 #if HAS_AUTO_FAN
@@ -717,7 +713,7 @@ void Temperature::manage_heater() {
717 713
     float pid_output = get_pid_output(e);
718 714
 
719 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 718
     // Check if the temperature is failing to increase
723 719
     #if WATCH_HOTENDS
@@ -798,27 +794,27 @@ void Temperature::manage_heater() {
798 794
     #if ENABLED(PIDTEMPBED)
799 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 799
     #elif ENABLED(BED_LIMIT_SWITCHING)
804 800
       // Check if temperature is within the correct band
805 801
       if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) {
806 802
         if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
807
-          soft_pwm_bed = 0;
803
+          soft_pwm_amount_bed = 0;
808 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 807
       else {
812
-        soft_pwm_bed = 0;
808
+        soft_pwm_amount_bed = 0;
813 809
         WRITE_HEATER_BED(LOW);
814 810
       }
815 811
     #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING
816 812
       // Check if temperature is within the correct range
817 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 816
       else {
821
-        soft_pwm_bed = 0;
817
+        soft_pwm_amount_bed = 0;
822 818
         WRITE_HEATER_BED(LOW);
823 819
       }
824 820
     #endif
@@ -1205,7 +1201,7 @@ void Temperature::init() {
1205 1201
 
1206 1202
   #if ENABLED(PROBING_HEATERS_OFF)
1207 1203
     paused = false;
1208
-    ZERO(paused_hotend_temps);
1204
+    ZERO(paused_hotend_temp);
1209 1205
     #if HAS_TEMP_BED
1210 1206
       paused_bed_temp = 0;
1211 1207
     #endif
@@ -1316,7 +1312,7 @@ void Temperature::disable_all_heaters() {
1316 1312
   // Unpause and reset everything
1317 1313
   #if ENABLED(PROBING_HEATERS_OFF)
1318 1314
     paused = false;
1319
-    ZERO(paused_hotend_temps);
1315
+    ZERO(paused_hotend_temp);
1320 1316
     #if HAS_TEMP_BED
1321 1317
       paused_bed_temp = 0;
1322 1318
     #endif
@@ -1327,7 +1323,7 @@ void Temperature::disable_all_heaters() {
1327 1323
 
1328 1324
   #define DISABLE_HEATER(NR) { \
1329 1325
     setTargetHotend(0, NR); \
1330
-    soft_pwm[NR] = 0; \
1326
+    soft_pwm_amount[NR] = 0; \
1331 1327
     WRITE_HEATER_ ##NR (LOW); \
1332 1328
   }
1333 1329
 
@@ -1349,7 +1345,7 @@ void Temperature::disable_all_heaters() {
1349 1345
 
1350 1346
   #if HAS_TEMP_BED
1351 1347
     target_temperature_bed = 0;
1352
-    soft_pwm_bed = 0;
1348
+    soft_pwm_amount_bed = 0;
1353 1349
     #if HAS_HEATER_BED
1354 1350
       WRITE_HEATER_BED(LOW);
1355 1351
     #endif
@@ -1357,36 +1353,29 @@ void Temperature::disable_all_heaters() {
1357 1353
 }
1358 1354
 
1359 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 1379
 #endif // PROBING_HEATERS_OFF
1391 1380
 
1392 1381
 #if ENABLED(HEATER_0_USES_MAX6675)
@@ -1613,11 +1602,11 @@ void Temperature::isr() {
1613 1602
   #if ENABLED(SLOW_PWM_HEATERS)
1614 1603
     static uint8_t slow_pwm_count = 0;
1615 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 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 1610
   #endif
1622 1611
 
1623 1612
   // Statics per heater
@@ -1656,73 +1645,73 @@ void Temperature::isr() {
1656 1645
      */
1657 1646
     if (pwm_count_tmp >= 127) {
1658 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 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 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 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 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 1662
             #endif // HOTENDS > 4
1674 1663
           #endif // HOTENDS > 3
1675 1664
         #endif // HOTENDS > 2
1676 1665
       #endif // HOTENDS > 1
1677 1666
 
1678 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 1670
       #endif
1682 1671
 
1683 1672
       #if ENABLED(FAN_SOFT_PWM)
1684 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 1676
         #endif
1688 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 1680
         #endif
1692 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 1684
         #endif
1696 1685
       #endif
1697 1686
     }
1698 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 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 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 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 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 1697
             #endif // HOTENDS > 4
1709 1698
           #endif // HOTENDS > 3
1710 1699
         #endif // HOTENDS > 2
1711 1700
       #endif // HOTENDS > 1
1712 1701
 
1713 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 1704
       #endif
1716 1705
 
1717 1706
       #if ENABLED(FAN_SOFT_PWM)
1718 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 1709
         #endif
1721 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 1712
         #endif
1724 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 1715
         #endif
1727 1716
       #endif
1728 1717
     }
@@ -1765,7 +1754,7 @@ void Temperature::isr() {
1765 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 1759
     #define PWM_OFF_ROUTINE(NR) \
1771 1760
       if (soft_pwm_ ##NR < slow_pwm_count) { \
@@ -1792,7 +1781,7 @@ void Temperature::isr() {
1792 1781
         #endif // HOTENDS > 2
1793 1782
       #endif // HOTENDS > 1
1794 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 1785
       #endif
1797 1786
 
1798 1787
     } // slow_pwm_count == 0
@@ -1818,26 +1807,26 @@ void Temperature::isr() {
1818 1807
       if (pwm_count_tmp >= 127) {
1819 1808
         pwm_count_tmp = 0;
1820 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 1812
         #endif
1824 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 1816
         #endif
1828 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 1820
         #endif
1832 1821
       }
1833 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 1824
       #endif
1836 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 1827
       #endif
1839 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 1830
       #endif
1842 1831
     #endif // FAN_SOFT_PWM
1843 1832
 

+ 6
- 11
Marlin/temperature.h 파일 보기

@@ -109,10 +109,12 @@ class Temperature {
109 109
       static float redundant_temperature;
110 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 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 118
     #endif
117 119
 
118 120
     #if ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)
@@ -249,19 +251,13 @@ class Temperature {
249 251
       static millis_t next_auto_fan_check_ms;
250 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 254
     #if ENABLED(FILAMENT_WIDTH_SENSOR)
259 255
       static int current_raw_filwidth;  //Holds measured filament diameter - one extruder only
260 256
     #endif
261 257
 
262 258
     #if ENABLED(PROBING_HEATERS_OFF)
263 259
       static bool paused;
264
-      static int16_t paused_hotend_temps[HOTENDS];
260
+      static int16_t paused_hotend_temp[HOTENDS];
265 261
 
266 262
       #if HAS_TEMP_BED
267 263
         static int16_t paused_bed_temp;
@@ -462,8 +458,7 @@ class Temperature {
462 458
     #endif // BABYSTEPPING
463 459
 
464 460
     #if ENABLED(PROBING_HEATERS_OFF)
465
-      static void pause(bool p);
466
-      static bool ispaused();
461
+      static void pause(const bool p);
467 462
     #endif
468 463
 
469 464
   private:

+ 1
- 1
Marlin/ubl_G29.cpp 파일 보기

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

+ 1
- 1
Marlin/ubl_motion.cpp 파일 보기

@@ -225,7 +225,7 @@
225 225
     const float e_normalized_dist = e_position / on_axis_distance,
226 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 229
         current_yi = cell_start_yi;
230 230
 
231 231
     const float m = dy / dx,

+ 29
- 29
README.md 파일 보기

@@ -113,37 +113,37 @@ Proposed patches should be submitted as a Pull Request against this branch ([bug
113 113
 ## Credits
114 114
 
115 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 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 147
  - ...and many others
148 148
 
149 149
 ## License

Loading…
취소
저장