Przeglądaj źródła

Add HAS_FAN and others

Scott Lahteine 4 lat temu
rodzic
commit
8b3c7dda75
35 zmienionych plików z 85 dodań i 90 usunięć
  1. 2
    2
      Marlin/src/feature/pause.cpp
  2. 2
    2
      Marlin/src/feature/powerloss.cpp
  3. 1
    1
      Marlin/src/feature/powerloss.h
  4. 1
    1
      Marlin/src/feature/probe_temp_comp.h
  5. 2
    2
      Marlin/src/gcode/bedlevel/G26.cpp
  6. 1
    1
      Marlin/src/gcode/calibrate/G76_M871.cpp
  7. 1
    1
      Marlin/src/gcode/config/M217.cpp
  8. 2
    2
      Marlin/src/gcode/control/M42.cpp
  9. 1
    1
      Marlin/src/gcode/control/M80_M81.cpp
  10. 1
    1
      Marlin/src/gcode/gcode.cpp
  11. 1
    1
      Marlin/src/gcode/gcode.h
  12. 1
    1
      Marlin/src/gcode/lcd/M145.cpp
  13. 2
    2
      Marlin/src/gcode/temp/M106_M107.cpp
  14. 2
    0
      Marlin/src/inc/Conditionals_LCD.h
  15. 2
    0
      Marlin/src/inc/Conditionals_post.h
  16. 1
    1
      Marlin/src/inc/SanityCheck.h
  17. 2
    2
      Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
  18. 2
    2
      Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
  19. 2
    2
      Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h
  20. 4
    4
      Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp
  21. 5
    5
      Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp
  22. 2
    2
      Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp
  23. 3
    3
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp
  24. 4
    4
      Marlin/src/lcd/extui/ui_api.cpp
  25. 1
    1
      Marlin/src/lcd/menu/menu.h
  26. 1
    1
      Marlin/src/lcd/menu/menu_configuration.cpp
  27. 11
    20
      Marlin/src/lcd/menu/menu_temperature.cpp
  28. 3
    3
      Marlin/src/lcd/menu/menu_tune.cpp
  29. 2
    2
      Marlin/src/lcd/menu/menu_ubl.cpp
  30. 7
    7
      Marlin/src/module/planner.cpp
  31. 1
    1
      Marlin/src/module/planner.h
  32. 3
    3
      Marlin/src/module/temperature.cpp
  33. 4
    4
      Marlin/src/module/temperature.h
  34. 4
    4
      Marlin/src/module/tool_change.cpp
  35. 1
    1
      Marlin/src/module/tool_change.h

+ 2
- 2
Marlin/src/feature/pause.cpp Wyświetl plik

@@ -402,7 +402,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float
402 402
   // Wait for buffered blocks to complete
403 403
   planner.synchronize();
404 404
 
405
-  #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0
405
+  #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN
406 406
     thermalManager.set_fans_paused(true);
407 407
   #endif
408 408
 
@@ -621,7 +621,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
621 621
     if (did_pause_print) { card.startFileprint(); --did_pause_print; }
622 622
   #endif
623 623
 
624
-  #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0
624
+  #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN
625 625
     thermalManager.set_fans_paused(false);
626 626
   #endif
627 627
 

+ 2
- 2
Marlin/src/feature/powerloss.cpp Wyświetl plik

@@ -195,7 +195,7 @@ void PrintJobRecovery::save(const bool force/*=false*/) {
195 195
 
196 196
     TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.temp_bed.target);
197 197
 
198
-    #if FAN_COUNT
198
+    #if HAS_FAN
199 199
       COPY(info.fan_speed, thermalManager.fan_speed);
200 200
     #endif
201 201
 
@@ -508,7 +508,7 @@ void PrintJobRecovery::resume() {
508 508
           DEBUG_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed);
509 509
         #endif
510 510
 
511
-        #if FAN_COUNT
511
+        #if HAS_FAN
512 512
           DEBUG_ECHOPGM("fan_speed: ");
513 513
           FANS_LOOP(i) {
514 514
             DEBUG_ECHO(int(info.fan_speed[i]));

+ 1
- 1
Marlin/src/feature/powerloss.h Wyświetl plik

@@ -76,7 +76,7 @@ typedef struct {
76 76
     int16_t target_temperature_bed;
77 77
   #endif
78 78
 
79
-  #if FAN_COUNT
79
+  #if HAS_FAN
80 80
     uint8_t fan_speed[FAN_COUNT];
81 81
   #endif
82 82
 

+ 1
- 1
Marlin/src/feature/probe_temp_comp.h Wyświetl plik

@@ -65,7 +65,7 @@ class ProbeTempComp {
65 65
     static constexpr xy_pos_t measure_point    = PTC_PROBE_POS;     // Coordinates to probe
66 66
                             //measure_point    = { 12.0f, 7.3f };   // Coordinates for the MK52 magnetic heatbed
67 67
 
68
-    static constexpr int  probe_calib_bed_temp = BED_MAXTEMP - 10,  // Bed temperature while calibrating probe
68
+    static constexpr int  probe_calib_bed_temp = BED_MAX_TARGET,  // Bed temperature while calibrating probe
69 69
                           bed_calib_probe_temp = 30;                // Probe temperature while calibrating bed
70 70
 
71 71
     static int16_t *sensor_z_offsets[TSI_COUNT],

+ 2
- 2
Marlin/src/gcode/bedlevel/G26.cpp Wyświetl plik

@@ -511,8 +511,8 @@ void GcodeSuite::G26() {
511 511
   #if HAS_HEATED_BED
512 512
     if (parser.seenval('B')) {
513 513
       g26_bed_temp = parser.value_celsius();
514
-      if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, (BED_MAXTEMP - 10))) {
515
-        SERIAL_ECHOLNPAIR("?Specified bed temperature not plausible (40-", int(BED_MAXTEMP - 10), "C).");
514
+      if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, BED_MAX_TARGET)) {
515
+        SERIAL_ECHOLNPAIR("?Specified bed temperature not plausible (40-", int(BED_MAX_TARGET), "C).");
516 516
         return;
517 517
       }
518 518
     }

+ 1
- 1
Marlin/src/gcode/calibrate/G76_M871.cpp Wyświetl plik

@@ -201,7 +201,7 @@ void GcodeSuite::G76() {
201 201
         report_temps(next_temp_report);
202 202
 
203 203
       const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
204
-      if (isnan(measured_z) || target_bed > BED_MAXTEMP - 10) break;
204
+      if (isnan(measured_z) || target_bed > BED_MAX_TARGET) break;
205 205
     }
206 206
 
207 207
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

+ 1
- 1
Marlin/src/gcode/config/M217.cpp Wyświetl plik

@@ -115,7 +115,7 @@ void GcodeSuite::M217() {
115 115
     if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); }
116 116
     if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); }
117 117
     if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); }
118
-    #if TOOLCHANGE_FS_FAN >= 0 && FAN_COUNT > 0
118
+    #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
119 119
       if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); }
120 120
       if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); }
121 121
     #endif

+ 2
- 2
Marlin/src/gcode/control/M42.cpp Wyświetl plik

@@ -24,7 +24,7 @@
24 24
 #include "../../MarlinCore.h" // for pin_is_protected
25 25
 #include "../../inc/MarlinConfig.h"
26 26
 
27
-#if FAN_COUNT > 0
27
+#if HAS_FAN
28 28
   #include "../../module/temperature.h"
29 29
 #endif
30 30
 
@@ -64,7 +64,7 @@ void GcodeSuite::M42() {
64 64
   if (!parser.seenval('S')) return;
65 65
   const byte pin_status = parser.value_byte();
66 66
 
67
-  #if FAN_COUNT > 0
67
+  #if HAS_FAN
68 68
     switch (pin) {
69 69
       #if HAS_FAN0
70 70
         case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; return;

+ 1
- 1
Marlin/src/gcode/control/M80_M81.cpp Wyświetl plik

@@ -92,7 +92,7 @@ void GcodeSuite::M81() {
92 92
   print_job_timer.stop();
93 93
   planner.finish_and_disable();
94 94
 
95
-  #if FAN_COUNT > 0
95
+  #if HAS_FAN
96 96
     thermalManager.zero_fan_speeds();
97 97
     #if ENABLED(PROBING_FANS_OFF)
98 98
       thermalManager.fans_paused = false;

+ 1
- 1
Marlin/src/gcode/gcode.cpp Wyświetl plik

@@ -467,7 +467,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
467 467
 
468 468
       case 105: M105(); return;                                   // M105: Report Temperatures (and say "ok")
469 469
 
470
-      #if FAN_COUNT > 0
470
+      #if HAS_FAN
471 471
         case 106: M106(); break;                                  // M106: Fan On
472 472
         case 107: M107(); break;                                  // M107: Fan Off
473 473
       #endif

+ 1
- 1
Marlin/src/gcode/gcode.h Wyświetl plik

@@ -554,7 +554,7 @@ private:
554 554
 
555 555
   static void M105();
556 556
 
557
-  #if FAN_COUNT > 0
557
+  #if HAS_FAN
558 558
     static void M106();
559 559
     static void M107();
560 560
   #endif

+ 1
- 1
Marlin/src/gcode/lcd/M145.cpp Wyświetl plik

@@ -52,7 +52,7 @@ void GcodeSuite::M145() {
52 52
     #if TEMP_SENSOR_BED != 0
53 53
       if (parser.seenval('B')) {
54 54
         v = parser.value_int();
55
-        ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 10);
55
+        ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAX_TARGET);
56 56
       }
57 57
     #endif
58 58
   }

+ 2
- 2
Marlin/src/gcode/temp/M106_M107.cpp Wyświetl plik

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if FAN_COUNT > 0
25
+#if HAS_FAN
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../module/motion.h"
@@ -74,4 +74,4 @@ void GcodeSuite::M107() {
74 74
   thermalManager.set_fan_speed(p, 0);
75 75
 }
76 76
 
77
-#endif // FAN_COUNT > 0
77
+#endif // HAS_FAN

+ 2
- 0
Marlin/src/inc/Conditionals_LCD.h Wyświetl plik

@@ -408,6 +408,8 @@
408 408
  */
409 409
 
410 410
 #if EXTRUDERS == 0
411
+  #undef EXTRUDERS
412
+  #define EXTRUDERS 0
411 413
   #undef DISTINCT_E_FACTORS
412 414
   #undef SINGLENOZZLE
413 415
   #undef SWITCHING_EXTRUDER

+ 2
- 0
Marlin/src/inc/Conditionals_post.h Wyświetl plik

@@ -1707,6 +1707,7 @@
1707 1707
 // Shorthand for common combinations
1708 1708
 #if HAS_TEMP_BED && HAS_HEATER_BED
1709 1709
   #define HAS_HEATED_BED 1
1710
+  #define BED_MAX_TARGET (BED_MAXTEMP - 10)
1710 1711
 #endif
1711 1712
 #if HAS_HEATED_BED || HAS_TEMP_CHAMBER
1712 1713
   #define BED_OR_CHAMBER 1
@@ -2084,6 +2085,7 @@
2084 2085
 #endif
2085 2086
 
2086 2087
 #if FAN_COUNT > 0
2088
+  #define HAS_FAN 1
2087 2089
   #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ FAN_INVERTING)
2088 2090
 #endif
2089 2091
 

+ 1
- 1
Marlin/src/inc/SanityCheck.h Wyświetl plik

@@ -262,7 +262,7 @@
262 262
   #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
263 263
 #elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN)
264 264
   #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
265
-#elif defined(PID_FAN_SCALING) && FAN_COUNT <= 0
265
+#elif defined(PID_FAN_SCALING) && !HAS_FAN
266 266
   #error "PID_FAN_SCALING needs at least one fan enabled."
267 267
 #elif defined(min_software_endstops) || defined(max_software_endstops)
268 268
   #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."

+ 2
- 2
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Wyświetl plik

@@ -1072,7 +1072,7 @@ void MarlinUI::draw_status_screen() {
1072 1072
       if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) leds |= LED_A;
1073 1073
       if (TERN0(HAS_HOTEND, thermalManager.degTargetHotend(0) > 0)) leds |= LED_B;
1074 1074
 
1075
-      #if FAN_COUNT > 0
1075
+      #if HAS_FAN
1076 1076
         if ( TERN0(HAS_FAN0, thermalManager.fan_speed[0])
1077 1077
           || TERN0(HAS_FAN1, thermalManager.fan_speed[1])
1078 1078
           || TERN0(HAS_FAN2, thermalManager.fan_speed[2])
@@ -1082,7 +1082,7 @@ void MarlinUI::draw_status_screen() {
1082 1082
           || TERN0(HAS_FAN6, thermalManager.fan_speed[6])
1083 1083
           || TERN0(HAS_FAN7, thermalManager.fan_speed[7])
1084 1084
         ) leds |= LED_C;
1085
-      #endif // FAN_COUNT > 0
1085
+      #endif // HAS_FAN
1086 1086
 
1087 1087
       if (TERN0(HAS_MULTI_HOTEND, thermalManager.degTargetHotend(1) > 0)) leds |= LED_C;
1088 1088
 

+ 2
- 2
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp Wyświetl plik

@@ -277,7 +277,7 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable
277 277
 #endif
278 278
 
279 279
 // Send fan status value to the display.
280
-#if FAN_COUNT > 0
280
+#if HAS_FAN
281 281
   void DGUSScreenVariableHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) {
282 282
     if (var.memadr) {
283 283
       DEBUG_ECHOPAIR(" DGUSLCD_SendFanStatusToDisplay ", var.VP);
@@ -872,7 +872,7 @@ void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var,
872 872
   }
873 873
 #endif
874 874
 
875
-#if FAN_COUNT
875
+#if HAS_FAN
876 876
   void DGUSScreenVariableHandler::HandleFanControl(DGUS_VP_Variable &var, void *val_ptr) {
877 877
     DEBUG_ECHOLNPGM("HandleFanControl");
878 878
     *(uint8_t*)var.memadr = *(uint8_t*)var.memadr > 0 ? 0 : 255;

+ 2
- 2
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h Wyświetl plik

@@ -151,7 +151,7 @@ public:
151 151
     // Hook for live z adjust action
152 152
     static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr);
153 153
   #endif
154
-  #if FAN_COUNT > 0
154
+  #if HAS_FAN
155 155
     // Hook for fan control
156 156
     static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr);
157 157
   #endif
@@ -221,7 +221,7 @@ public:
221 221
     static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var);
222 222
     static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var);
223 223
   #endif
224
-  #if FAN_COUNT > 0
224
+  #if HAS_FAN
225 225
     static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var);
226 226
   #endif
227 227
   static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var);

+ 4
- 4
Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp Wyświetl plik

@@ -56,7 +56,7 @@ const uint16_t VPList_Main[] PROGMEM = {
56 56
   #if HAS_HEATED_BED
57 57
     VP_T_Bed_Is, VP_T_Bed_Set, VP_BED_STATUS,
58 58
   #endif
59
-  #if FAN_COUNT > 0
59
+  #if HAS_FAN
60 60
     VP_Fan0_Percentage, VP_FAN0_STATUS,
61 61
   #endif
62 62
   VP_XPos, VP_YPos, VP_ZPos,
@@ -92,7 +92,7 @@ const uint16_t VPList_Status[] PROGMEM = {
92 92
   #if HAS_HEATED_BED
93 93
     VP_T_Bed_Is, VP_T_Bed_Set,
94 94
   #endif
95
-  #if FAN_COUNT > 0
95
+  #if HAS_FAN
96 96
     VP_Fan0_Percentage,
97 97
   #endif
98 98
   VP_XPos, VP_YPos, VP_ZPos,
@@ -192,7 +192,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = {
192 192
   #if HAS_HEATED_BED
193 193
     VP_T_Bed_Is, VP_T_Bed_Set,
194 194
   #endif
195
-  #if FAN_COUNT > 0
195
+  #if HAS_FAN
196 196
     VP_Fan0_Percentage,
197 197
     #if FAN_COUNT > 1
198 198
       VP_Fan1_Percentage,
@@ -410,7 +410,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
410 410
   #endif
411 411
 
412 412
   // Fan Data
413
-  #if FAN_COUNT
413
+  #if HAS_FAN
414 414
     #define FAN_VPHELPER(N) \
415 415
       VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \
416 416
       VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \

+ 5
- 5
Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp Wyświetl plik

@@ -56,7 +56,7 @@ const uint16_t VPList_Main[] PROGMEM = {
56 56
   #if HAS_HEATED_BED
57 57
     VP_T_Bed_Is, VP_T_Bed_Set, VP_BED_STATUS,
58 58
   #endif
59
-  #if FAN_COUNT > 0
59
+  #if HAS_FAN
60 60
     VP_Fan0_Percentage, VP_FAN0_STATUS,
61 61
   #endif
62 62
   VP_XPos, VP_YPos, VP_ZPos,
@@ -92,7 +92,7 @@ const uint16_t VPList_Status[] PROGMEM = {
92 92
   #if HAS_HEATED_BED
93 93
     VP_T_Bed_Is, VP_T_Bed_Set,
94 94
   #endif
95
-  #if FAN_COUNT > 0
95
+  #if HAS_FAN
96 96
     VP_Fan0_Percentage,
97 97
   #endif
98 98
   VP_XPos, VP_YPos, VP_ZPos,
@@ -191,7 +191,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = {
191 191
   #if HAS_HEATED_BED
192 192
     VP_T_Bed_Is, VP_T_Bed_Set,
193 193
   #endif
194
-  #if FAN_COUNT > 0
194
+  #if HAS_FAN
195 195
     VP_Fan0_Percentage,
196 196
     #if FAN_COUNT > 1
197 197
       VP_Fan1_Percentage,
@@ -212,7 +212,7 @@ const uint16_t VPList_SDPrintTune[] PROGMEM = {
212 212
     VP_T_Bed_Is, VP_T_Bed_Set,
213 213
   #endif
214 214
   VP_Feedrate_Percentage,
215
-  #if FAN_COUNT > 0
215
+  #if HAS_FAN
216 216
     VP_Fan0_Percentage,
217 217
   #endif
218 218
   VP_Flowrate_E0,
@@ -409,7 +409,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
409 409
   #endif
410 410
 
411 411
   // Fan Data
412
-  #if FAN_COUNT
412
+  #if HAS_FAN
413 413
     #define FAN_VPHELPER(N) \
414 414
       VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \
415 415
       VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \

+ 2
- 2
Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp Wyświetl plik

@@ -73,7 +73,7 @@ const uint16_t VPList_Status[] PROGMEM = {
73 73
   #if HAS_HEATED_BED
74 74
     VP_T_Bed_Is, VP_T_Bed_Set,
75 75
   #endif
76
-  #if FAN_COUNT > 0
76
+  #if HAS_FAN
77 77
     VP_Fan0_Percentage,
78 78
   #endif
79 79
   VP_XPos, VP_YPos, VP_ZPos,
@@ -233,7 +233,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
233 233
   #endif
234 234
 
235 235
   // Fan Data
236
-  #if FAN_COUNT
236
+  #if HAS_FAN
237 237
     #define FAN_VPHELPER(N) \
238 238
       VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \
239 239
       VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \

+ 3
- 3
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp Wyświetl plik

@@ -60,7 +60,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) {
60 60
   #if HAS_HEATED_CHAMBER
61 61
     w.adjuster(    22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER));
62 62
   #endif
63
-  #if FAN_COUNT > 0
63
+  #if HAS_FAN
64 64
     w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT));
65 65
     w.adjuster(    10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0));
66 66
   #endif
@@ -90,7 +90,7 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) {
90 90
       case  8: UI_DECREMENT(TargetTemp_celsius, E3); break;
91 91
       case  9: UI_INCREMENT(TargetTemp_celsius, E3); break;
92 92
     #endif
93
-    #if FAN_COUNT > 0
93
+    #if HAS_FAN
94 94
       case 10: UI_DECREMENT(TargetFan_percent, FAN0); break;
95 95
       case 11: UI_INCREMENT(TargetFan_percent, FAN0); break;
96 96
     #endif
@@ -99,7 +99,7 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) {
99 99
       REPEAT(HOTENDS, _HOTEND_OFF);
100 100
       TERN_(HAS_HEATED_BED, setTargetTemp_celsius(0,BED));
101 101
       TERN_(HAS_HEATED_CHAMBER, setTargetTemp_celsius(0,CHAMBER));
102
-      #if FAN_COUNT > 0
102
+      #if HAS_FAN
103 103
         setTargetFan_percent(0,FAN0);
104 104
       #endif
105 105
       break;

+ 4
- 4
Marlin/src/lcd/extui/ui_api.cpp Wyświetl plik

@@ -293,7 +293,7 @@ namespace ExtUI {
293 293
   }
294 294
 
295 295
   float getTargetFan_percent(const fan_t fan) {
296
-    #if FAN_COUNT > 0
296
+    #if HAS_FAN
297 297
       return thermalManager.fanPercent(thermalManager.fan_speed[fan - FAN0]);
298 298
     #else
299 299
       UNUSED(fan);
@@ -302,7 +302,7 @@ namespace ExtUI {
302 302
   }
303 303
 
304 304
   float getActualFan_percent(const fan_t fan) {
305
-    #if FAN_COUNT > 0
305
+    #if HAS_FAN
306 306
       return thermalManager.fanPercent(thermalManager.scaledFanSpeed(fan - FAN0));
307 307
     #else
308 308
       UNUSED(fan);
@@ -940,7 +940,7 @@ namespace ExtUI {
940 940
     #endif
941 941
     #if HAS_HEATED_BED
942 942
       if (heater == BED)
943
-        thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAXTEMP - 10)));
943
+        thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAX_TARGET)));
944 944
       else
945 945
     #endif
946 946
       {
@@ -963,7 +963,7 @@ namespace ExtUI {
963 963
   }
964 964
 
965 965
   void setTargetFan_percent(const float value, const fan_t fan) {
966
-    #if FAN_COUNT > 0
966
+    #if HAS_FAN
967 967
       if (fan < FAN_COUNT)
968 968
         thermalManager.set_fan_speed(fan - FAN0, map(constrain(value, 0, 100), 0, 100, 0, 255));
969 969
     #else

+ 1
- 1
Marlin/src/lcd/menu/menu.h Wyświetl plik

@@ -522,7 +522,7 @@ void menu_move();
522 522
 #endif
523 523
 
524 524
 // First Fan Speed title in "Tune" and "Control>Temperature" menus
525
-#if FAN_COUNT > 0 && HAS_FAN0
525
+#if HAS_FAN && HAS_FAN0
526 526
   #if FAN_COUNT > 1
527 527
     #define FAN_SPEED_1_SUFFIX " 1"
528 528
   #else

+ 1
- 1
Marlin/src/lcd/menu/menu_configuration.cpp Wyświetl plik

@@ -334,7 +334,7 @@ void menu_advanced_settings();
334 334
       EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
335 335
     #endif
336 336
     #if HAS_HEATED_BED
337
-      EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 10);
337
+      EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAX_TARGET);
338 338
     #endif
339 339
     #if ENABLED(EEPROM_SETTINGS)
340 340
       ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);

+ 11
- 20
Marlin/src/lcd/menu/menu_temperature.cpp Wyświetl plik

@@ -47,47 +47,38 @@ uint8_t MarlinUI::preheat_fan_speed[2];
47 47
 // "Temperature" submenu items
48 48
 //
49 49
 
50
-
51 50
 void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) {
52 51
   #if HAS_HOTEND
53 52
     if (indh >= 0 && ui.preheat_hotend_temp[indh] > 0)
54 53
       setTargetHotend(_MIN(heater_maxtemp[e] - 15, ui.preheat_hotend_temp[indh]), e);
55 54
   #else
55
+    UNUSED(e);
56 56
     UNUSED(temph);
57 57
   #endif
58 58
   #if HAS_HEATED_BED
59
-    if (indb >= 0 && ui.preheat_bed_temp[indb] >= 0) setTargetBed(ui.preheat_bed_temp[indb]);
59
+    if (indb >= 0 && ui.preheat_bed_temp[indb] > 0) setTargetBed(ui.preheat_bed_temp[indb]);
60 60
   #else
61 61
     UNUSED(indb);
62 62
   #endif
63 63
   #if HAS_FAN
64 64
     set_fan_speed((
65 65
       #if FAN_COUNT > 1
66
-        active_extruder < FAN_COUNT ? active_extruder : 0
67
-      #else
68
-        0
66
+        active_extruder < FAN_COUNT ? active_extruder :
69 67
       #endif
70
-    ), fan);
71
-  #else
72
-    UNUSED(fan);
68
+      0), ui.preheat_fan_speed[m]
69
+    );
73 70
   #endif
74 71
   ui.return_to_status();
75 72
 }
76 73
 
77 74
 #if HAS_TEMP_HOTEND
78
-  inline void _preheat_end(const uint8_t m, const uint8_t e) {
79
-    thermalManager.lcd_preheat(e, m, -1);
80
-  }
75
+  inline void _preheat_end(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); }
81 76
   #if HAS_HEATED_BED
82
-    inline void _preheat_both(const uint8_t m, const uint8_t e) {
83
-      thermalManager.lcd_preheat(e, m, m);
84
-    }
77
+    inline void _preheat_both(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, m); }
85 78
   #endif
86 79
 #endif
87 80
 #if HAS_HEATED_BED
88
-  inline void _preheat_bed(const uint8_t m) {
89
-    thermalManager.lcd_preheat(-1, -1, m);
90
-  }
81
+  inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(-1, -1, m); }
91 82
 #endif
92 83
 
93 84
 #if HAS_TEMP_HOTEND || HAS_HEATED_BED
@@ -186,7 +177,7 @@ void menu_temperature() {
186 177
   // Bed:
187 178
   //
188 179
   #if HAS_HEATED_BED
189
-    EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed);
180
+    EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed);
190 181
   #endif
191 182
 
192 183
   //
@@ -199,7 +190,7 @@ void menu_temperature() {
199 190
   //
200 191
   // Fan Speed:
201 192
   //
202
-  #if FAN_COUNT > 0
193
+  #if HAS_FAN
203 194
 
204 195
     auto on_fan_update = []{
205 196
       thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
@@ -266,7 +257,7 @@ void menu_temperature() {
266 257
       singlenozzle_item(1);
267 258
     #endif
268 259
 
269
-  #endif // FAN_COUNT > 0
260
+  #endif // HAS_FAN
270 261
 
271 262
   #if HAS_TEMP_HOTEND
272 263
 

+ 3
- 3
Marlin/src/lcd/menu/menu_tune.cpp Wyświetl plik

@@ -132,13 +132,13 @@ void menu_tune() {
132 132
   // Bed:
133 133
   //
134 134
   #if HAS_HEATED_BED
135
-    EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed);
135
+    EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed);
136 136
   #endif
137 137
 
138 138
   //
139 139
   // Fan Speed:
140 140
   //
141
-  #if FAN_COUNT > 0
141
+  #if HAS_FAN
142 142
 
143 143
     auto on_fan_update = []{
144 144
       thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
@@ -205,7 +205,7 @@ void menu_tune() {
205 205
       singlenozzle_item(1);
206 206
     #endif
207 207
 
208
-  #endif // FAN_COUNT > 0
208
+  #endif // HAS_FAN
209 209
 
210 210
   //
211 211
   // Flow:

+ 2
- 2
Marlin/src/lcd/menu/menu_ubl.cpp Wyświetl plik

@@ -128,9 +128,9 @@ void _lcd_ubl_build_custom_mesh() {
128 128
 void _lcd_ubl_custom_mesh() {
129 129
   START_MENU();
130 130
   BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
131
-  EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10));
131
+  EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 15));
132 132
   #if HAS_HEATED_BED
133
-    EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 10));
133
+    EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, BED_MAX_TARGET);
134 134
   #endif
135 135
   ACTION_ITEM(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh);
136 136
   END_MENU();

+ 7
- 7
Marlin/src/module/planner.cpp Wyświetl plik

@@ -1264,7 +1264,7 @@ void Planner::check_axes_activity() {
1264 1264
     xyze_bool_t axis_active = { false };
1265 1265
   #endif
1266 1266
 
1267
-  #if FAN_COUNT > 0
1267
+  #if HAS_FAN
1268 1268
     uint8_t tail_fan_speed[FAN_COUNT];
1269 1269
   #endif
1270 1270
 
@@ -1279,11 +1279,11 @@ void Planner::check_axes_activity() {
1279 1279
 
1280 1280
   if (has_blocks_queued()) {
1281 1281
 
1282
-    #if FAN_COUNT > 0 || ENABLED(BARICUDA)
1282
+    #if HAS_FAN || ENABLED(BARICUDA)
1283 1283
       block_t *block = &block_buffer[block_buffer_tail];
1284 1284
     #endif
1285 1285
 
1286
-    #if FAN_COUNT > 0
1286
+    #if HAS_FAN
1287 1287
       FANS_LOOP(i)
1288 1288
         tail_fan_speed[i] = thermalManager.scaledFanSpeed(i, block->fan_speed[i]);
1289 1289
     #endif
@@ -1304,7 +1304,7 @@ void Planner::check_axes_activity() {
1304 1304
 
1305 1305
     TERN_(HAS_CUTTER, cutter.refresh());
1306 1306
 
1307
-    #if FAN_COUNT > 0
1307
+    #if HAS_FAN
1308 1308
       FANS_LOOP(i)
1309 1309
         tail_fan_speed[i] = thermalManager.scaledFanSpeed(i);
1310 1310
     #endif
@@ -1326,7 +1326,7 @@ void Planner::check_axes_activity() {
1326 1326
   //
1327 1327
   // Update Fan speeds
1328 1328
   //
1329
-  #if FAN_COUNT > 0
1329
+  #if HAS_FAN
1330 1330
 
1331 1331
     #if FAN_KICKSTART_TIME > 0
1332 1332
       static millis_t fan_kick_end[FAN_COUNT] = { 0 };
@@ -1366,7 +1366,7 @@ void Planner::check_axes_activity() {
1366 1366
     TERN_(HAS_FAN5, FAN_SET(5));
1367 1367
     TERN_(HAS_FAN6, FAN_SET(6));
1368 1368
     TERN_(HAS_FAN7, FAN_SET(7));
1369
-  #endif // FAN_COUNT > 0
1369
+  #endif // HAS_FAN
1370 1370
 
1371 1371
   TERN_(AUTOTEMP, getHighESpeed());
1372 1372
 
@@ -1906,7 +1906,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1906 1906
 
1907 1907
   TERN_(HAS_CUTTER, block->cutter_power = cutter.power);
1908 1908
 
1909
-  #if FAN_COUNT > 0
1909
+  #if HAS_FAN
1910 1910
     FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i];
1911 1911
   #endif
1912 1912
 

+ 1
- 1
Marlin/src/module/planner.h Wyświetl plik

@@ -175,7 +175,7 @@ typedef struct block_t {
175 175
     cutter_power_t cutter_power;            // Power level for Spindle, Laser, etc.
176 176
   #endif
177 177
 
178
-  #if FAN_COUNT > 0
178
+  #if HAS_FAN
179 179
     uint8_t fan_speed[FAN_COUNT];
180 180
   #endif
181 181
 

+ 3
- 3
Marlin/src/module/temperature.cpp Wyświetl plik

@@ -152,7 +152,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
152 152
   uint8_t Temperature::chamberfan_speed; // = 0
153 153
 #endif
154 154
 
155
-#if FAN_COUNT > 0
155
+#if HAS_FAN
156 156
 
157 157
   uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
158 158
 
@@ -219,7 +219,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
219 219
 
220 220
   #endif
221 221
 
222
-#endif // FAN_COUNT > 0
222
+#endif // HAS_FAN
223 223
 
224 224
 #if WATCH_HOTENDS
225 225
   hotend_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } }
@@ -400,7 +400,7 @@ volatile bool Temperature::raw_temps_ready = false;
400 400
 
401 401
     TERN_(HAS_AUTO_FAN, next_auto_fan_check_ms = next_temp_ms + 2500UL);
402 402
 
403
-    if (target > GHV(BED_MAXTEMP - 10, temp_range[heater].maxtemp - 15)) {
403
+    if (target > GHV(BED_MAX_TARGET, temp_range[heater].maxtemp - 15)) {
404 404
       SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
405 405
       TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
406 406
       return;

+ 4
- 4
Marlin/src/module/temperature.h Wyświetl plik

@@ -477,7 +477,7 @@ class Temperature {
477 477
       static float analog_to_celsius_chamber(const int raw);
478 478
     #endif
479 479
 
480
-    #if FAN_COUNT > 0
480
+    #if HAS_FAN
481 481
 
482 482
       static uint8_t fan_speed[FAN_COUNT];
483 483
       #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT)
@@ -517,10 +517,10 @@ class Temperature {
517 517
         void set_fans_paused(const bool p);
518 518
       #endif
519 519
 
520
-    #endif // FAN_COUNT > 0
520
+    #endif // HAS_FAN
521 521
 
522 522
     static inline void zero_fan_speeds() {
523
-      #if FAN_COUNT > 0
523
+      #if HAS_FAN
524 524
         FANS_LOOP(i) set_fan_speed(i, 0);
525 525
       #endif
526 526
     }
@@ -634,7 +634,7 @@ class Temperature {
634 634
         TERN_(AUTO_POWER_CONTROL, powerManager.power_on());
635 635
         temp_bed.target =
636 636
           #ifdef BED_MAXTEMP
637
-            _MIN(celsius, BED_MAXTEMP - 10)
637
+            _MIN(celsius, BED_MAX_TARGET)
638 638
           #else
639 639
             celsius
640 640
           #endif

+ 4
- 4
Marlin/src/module/tool_change.cpp Wyświetl plik

@@ -49,7 +49,7 @@
49 49
 
50 50
 #if ENABLED(SINGLENOZZLE)
51 51
   uint16_t singlenozzle_temp[EXTRUDERS];
52
-  #if FAN_COUNT > 0
52
+  #if HAS_FAN
53 53
     uint8_t singlenozzle_fan_speed[EXTRUDERS];
54 54
   #endif
55 55
 #endif
@@ -819,7 +819,7 @@ void tool_change_prime() {
819 819
     #endif
820 820
 
821 821
     // Cool down with fan
822
-    #if TOOLCHANGE_FS_FAN >= 0 && FAN_COUNT > 0
822
+    #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
823 823
       const int16_t fansp = thermalManager.fan_speed[TOOLCHANGE_FS_FAN];
824 824
       thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
825 825
       safe_delay(toolchange_settings.fan_time * 1000);
@@ -1060,7 +1060,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1060 1060
       if (should_move) {
1061 1061
 
1062 1062
         #if ENABLED(SINGLENOZZLE)
1063
-          #if FAN_COUNT > 0
1063
+          #if HAS_FAN
1064 1064
             singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0];
1065 1065
             thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool];
1066 1066
           #endif
@@ -1098,7 +1098,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1098 1098
             #endif
1099 1099
 
1100 1100
             // Cool down with fan
1101
-            #if TOOLCHANGE_FS_FAN >= 0 && FAN_COUNT > 0
1101
+            #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
1102 1102
               const int16_t fansp = thermalManager.fan_speed[TOOLCHANGE_FS_FAN];
1103 1103
               thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
1104 1104
               safe_delay(toolchange_settings.fan_time * 1000);

+ 1
- 1
Marlin/src/module/tool_change.h Wyświetl plik

@@ -110,7 +110,7 @@
110 110
 
111 111
 #if ENABLED(SINGLENOZZLE)
112 112
   extern uint16_t singlenozzle_temp[EXTRUDERS];
113
-  #if FAN_COUNT > 0
113
+  #if HAS_FAN
114 114
     extern uint8_t singlenozzle_fan_speed[EXTRUDERS];
115 115
   #endif
116 116
 #endif

Ładowanie…
Anuluj
Zapisz