Scott Lahteine 4 лет назад
Родитель
Сommit
8b3c7dda75
35 измененных файлов: 85 добавлений и 90 удалений
  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 Просмотреть файл

402
   // Wait for buffered blocks to complete
402
   // Wait for buffered blocks to complete
403
   planner.synchronize();
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
     thermalManager.set_fans_paused(true);
406
     thermalManager.set_fans_paused(true);
407
   #endif
407
   #endif
408
 
408
 
621
     if (did_pause_print) { card.startFileprint(); --did_pause_print; }
621
     if (did_pause_print) { card.startFileprint(); --did_pause_print; }
622
   #endif
622
   #endif
623
 
623
 
624
-  #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0
624
+  #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN
625
     thermalManager.set_fans_paused(false);
625
     thermalManager.set_fans_paused(false);
626
   #endif
626
   #endif
627
 
627
 

+ 2
- 2
Marlin/src/feature/powerloss.cpp Просмотреть файл

195
 
195
 
196
     TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.temp_bed.target);
196
     TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.temp_bed.target);
197
 
197
 
198
-    #if FAN_COUNT
198
+    #if HAS_FAN
199
       COPY(info.fan_speed, thermalManager.fan_speed);
199
       COPY(info.fan_speed, thermalManager.fan_speed);
200
     #endif
200
     #endif
201
 
201
 
508
           DEBUG_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed);
508
           DEBUG_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed);
509
         #endif
509
         #endif
510
 
510
 
511
-        #if FAN_COUNT
511
+        #if HAS_FAN
512
           DEBUG_ECHOPGM("fan_speed: ");
512
           DEBUG_ECHOPGM("fan_speed: ");
513
           FANS_LOOP(i) {
513
           FANS_LOOP(i) {
514
             DEBUG_ECHO(int(info.fan_speed[i]));
514
             DEBUG_ECHO(int(info.fan_speed[i]));

+ 1
- 1
Marlin/src/feature/powerloss.h Просмотреть файл

76
     int16_t target_temperature_bed;
76
     int16_t target_temperature_bed;
77
   #endif
77
   #endif
78
 
78
 
79
-  #if FAN_COUNT
79
+  #if HAS_FAN
80
     uint8_t fan_speed[FAN_COUNT];
80
     uint8_t fan_speed[FAN_COUNT];
81
   #endif
81
   #endif
82
 
82
 

+ 1
- 1
Marlin/src/feature/probe_temp_comp.h Просмотреть файл

65
     static constexpr xy_pos_t measure_point    = PTC_PROBE_POS;     // Coordinates to probe
65
     static constexpr xy_pos_t measure_point    = PTC_PROBE_POS;     // Coordinates to probe
66
                             //measure_point    = { 12.0f, 7.3f };   // Coordinates for the MK52 magnetic heatbed
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
                           bed_calib_probe_temp = 30;                // Probe temperature while calibrating bed
69
                           bed_calib_probe_temp = 30;                // Probe temperature while calibrating bed
70
 
70
 
71
     static int16_t *sensor_z_offsets[TSI_COUNT],
71
     static int16_t *sensor_z_offsets[TSI_COUNT],

+ 2
- 2
Marlin/src/gcode/bedlevel/G26.cpp Просмотреть файл

511
   #if HAS_HEATED_BED
511
   #if HAS_HEATED_BED
512
     if (parser.seenval('B')) {
512
     if (parser.seenval('B')) {
513
       g26_bed_temp = parser.value_celsius();
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
         return;
516
         return;
517
       }
517
       }
518
     }
518
     }

+ 1
- 1
Marlin/src/gcode/calibrate/G76_M871.cpp Просмотреть файл

201
         report_temps(next_temp_report);
201
         report_temps(next_temp_report);
202
 
202
 
203
       const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
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
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
207
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

+ 1
- 1
Marlin/src/gcode/config/M217.cpp Просмотреть файл

115
     if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); }
115
     if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); }
116
     if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); }
116
     if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); }
117
     if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); }
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
       if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); }
119
       if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); }
120
       if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); }
120
       if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); }
121
     #endif
121
     #endif

+ 2
- 2
Marlin/src/gcode/control/M42.cpp Просмотреть файл

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

+ 1
- 1
Marlin/src/gcode/control/M80_M81.cpp Просмотреть файл

92
   print_job_timer.stop();
92
   print_job_timer.stop();
93
   planner.finish_and_disable();
93
   planner.finish_and_disable();
94
 
94
 
95
-  #if FAN_COUNT > 0
95
+  #if HAS_FAN
96
     thermalManager.zero_fan_speeds();
96
     thermalManager.zero_fan_speeds();
97
     #if ENABLED(PROBING_FANS_OFF)
97
     #if ENABLED(PROBING_FANS_OFF)
98
       thermalManager.fans_paused = false;
98
       thermalManager.fans_paused = false;

+ 1
- 1
Marlin/src/gcode/gcode.cpp Просмотреть файл

467
 
467
 
468
       case 105: M105(); return;                                   // M105: Report Temperatures (and say "ok")
468
       case 105: M105(); return;                                   // M105: Report Temperatures (and say "ok")
469
 
469
 
470
-      #if FAN_COUNT > 0
470
+      #if HAS_FAN
471
         case 106: M106(); break;                                  // M106: Fan On
471
         case 106: M106(); break;                                  // M106: Fan On
472
         case 107: M107(); break;                                  // M107: Fan Off
472
         case 107: M107(); break;                                  // M107: Fan Off
473
       #endif
473
       #endif

+ 1
- 1
Marlin/src/gcode/gcode.h Просмотреть файл

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

+ 1
- 1
Marlin/src/gcode/lcd/M145.cpp Просмотреть файл

52
     #if TEMP_SENSOR_BED != 0
52
     #if TEMP_SENSOR_BED != 0
53
       if (parser.seenval('B')) {
53
       if (parser.seenval('B')) {
54
         v = parser.value_int();
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
     #endif
57
     #endif
58
   }
58
   }

+ 2
- 2
Marlin/src/gcode/temp/M106_M107.cpp Просмотреть файл

22
 
22
 
23
 #include "../../inc/MarlinConfig.h"
23
 #include "../../inc/MarlinConfig.h"
24
 
24
 
25
-#if FAN_COUNT > 0
25
+#if HAS_FAN
26
 
26
 
27
 #include "../gcode.h"
27
 #include "../gcode.h"
28
 #include "../../module/motion.h"
28
 #include "../../module/motion.h"
74
   thermalManager.set_fan_speed(p, 0);
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 Просмотреть файл

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

+ 2
- 0
Marlin/src/inc/Conditionals_post.h Просмотреть файл

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

+ 1
- 1
Marlin/src/inc/SanityCheck.h Просмотреть файл

262
   #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
262
   #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
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)
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
   #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
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
   #error "PID_FAN_SCALING needs at least one fan enabled."
266
   #error "PID_FAN_SCALING needs at least one fan enabled."
267
 #elif defined(min_software_endstops) || defined(max_software_endstops)
267
 #elif defined(min_software_endstops) || defined(max_software_endstops)
268
   #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
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 Просмотреть файл

1072
       if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) leds |= LED_A;
1072
       if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) leds |= LED_A;
1073
       if (TERN0(HAS_HOTEND, thermalManager.degTargetHotend(0) > 0)) leds |= LED_B;
1073
       if (TERN0(HAS_HOTEND, thermalManager.degTargetHotend(0) > 0)) leds |= LED_B;
1074
 
1074
 
1075
-      #if FAN_COUNT > 0
1075
+      #if HAS_FAN
1076
         if ( TERN0(HAS_FAN0, thermalManager.fan_speed[0])
1076
         if ( TERN0(HAS_FAN0, thermalManager.fan_speed[0])
1077
           || TERN0(HAS_FAN1, thermalManager.fan_speed[1])
1077
           || TERN0(HAS_FAN1, thermalManager.fan_speed[1])
1078
           || TERN0(HAS_FAN2, thermalManager.fan_speed[2])
1078
           || TERN0(HAS_FAN2, thermalManager.fan_speed[2])
1082
           || TERN0(HAS_FAN6, thermalManager.fan_speed[6])
1082
           || TERN0(HAS_FAN6, thermalManager.fan_speed[6])
1083
           || TERN0(HAS_FAN7, thermalManager.fan_speed[7])
1083
           || TERN0(HAS_FAN7, thermalManager.fan_speed[7])
1084
         ) leds |= LED_C;
1084
         ) leds |= LED_C;
1085
-      #endif // FAN_COUNT > 0
1085
+      #endif // HAS_FAN
1086
 
1086
 
1087
       if (TERN0(HAS_MULTI_HOTEND, thermalManager.degTargetHotend(1) > 0)) leds |= LED_C;
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 Просмотреть файл

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

+ 2
- 2
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h Просмотреть файл

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

+ 4
- 4
Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp Просмотреть файл

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

+ 5
- 5
Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp Просмотреть файл

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

+ 2
- 2
Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp Просмотреть файл

73
   #if HAS_HEATED_BED
73
   #if HAS_HEATED_BED
74
     VP_T_Bed_Is, VP_T_Bed_Set,
74
     VP_T_Bed_Is, VP_T_Bed_Set,
75
   #endif
75
   #endif
76
-  #if FAN_COUNT > 0
76
+  #if HAS_FAN
77
     VP_Fan0_Percentage,
77
     VP_Fan0_Percentage,
78
   #endif
78
   #endif
79
   VP_XPos, VP_YPos, VP_ZPos,
79
   VP_XPos, VP_YPos, VP_ZPos,
233
   #endif
233
   #endif
234
 
234
 
235
   // Fan Data
235
   // Fan Data
236
-  #if FAN_COUNT
236
+  #if HAS_FAN
237
     #define FAN_VPHELPER(N) \
237
     #define FAN_VPHELPER(N) \
238
       VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \
238
       VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \
239
       VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \
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 Просмотреть файл

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

+ 4
- 4
Marlin/src/lcd/extui/ui_api.cpp Просмотреть файл

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

+ 1
- 1
Marlin/src/lcd/menu/menu.h Просмотреть файл

522
 #endif
522
 #endif
523
 
523
 
524
 // First Fan Speed title in "Tune" and "Control>Temperature" menus
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
   #if FAN_COUNT > 1
526
   #if FAN_COUNT > 1
527
     #define FAN_SPEED_1_SUFFIX " 1"
527
     #define FAN_SPEED_1_SUFFIX " 1"
528
   #else
528
   #else

+ 1
- 1
Marlin/src/lcd/menu/menu_configuration.cpp Просмотреть файл

334
       EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
334
       EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
335
     #endif
335
     #endif
336
     #if HAS_HEATED_BED
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
     #endif
338
     #endif
339
     #if ENABLED(EEPROM_SETTINGS)
339
     #if ENABLED(EEPROM_SETTINGS)
340
       ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
340
       ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);

+ 11
- 20
Marlin/src/lcd/menu/menu_temperature.cpp Просмотреть файл

47
 // "Temperature" submenu items
47
 // "Temperature" submenu items
48
 //
48
 //
49
 
49
 
50
-
51
 void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) {
50
 void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) {
52
   #if HAS_HOTEND
51
   #if HAS_HOTEND
53
     if (indh >= 0 && ui.preheat_hotend_temp[indh] > 0)
52
     if (indh >= 0 && ui.preheat_hotend_temp[indh] > 0)
54
       setTargetHotend(_MIN(heater_maxtemp[e] - 15, ui.preheat_hotend_temp[indh]), e);
53
       setTargetHotend(_MIN(heater_maxtemp[e] - 15, ui.preheat_hotend_temp[indh]), e);
55
   #else
54
   #else
55
+    UNUSED(e);
56
     UNUSED(temph);
56
     UNUSED(temph);
57
   #endif
57
   #endif
58
   #if HAS_HEATED_BED
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
   #else
60
   #else
61
     UNUSED(indb);
61
     UNUSED(indb);
62
   #endif
62
   #endif
63
   #if HAS_FAN
63
   #if HAS_FAN
64
     set_fan_speed((
64
     set_fan_speed((
65
       #if FAN_COUNT > 1
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
       #endif
67
       #endif
70
-    ), fan);
71
-  #else
72
-    UNUSED(fan);
68
+      0), ui.preheat_fan_speed[m]
69
+    );
73
   #endif
70
   #endif
74
   ui.return_to_status();
71
   ui.return_to_status();
75
 }
72
 }
76
 
73
 
77
 #if HAS_TEMP_HOTEND
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
   #if HAS_HEATED_BED
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
   #endif
78
   #endif
86
 #endif
79
 #endif
87
 #if HAS_HEATED_BED
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
 #endif
82
 #endif
92
 
83
 
93
 #if HAS_TEMP_HOTEND || HAS_HEATED_BED
84
 #if HAS_TEMP_HOTEND || HAS_HEATED_BED
186
   // Bed:
177
   // Bed:
187
   //
178
   //
188
   #if HAS_HEATED_BED
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
   #endif
181
   #endif
191
 
182
 
192
   //
183
   //
199
   //
190
   //
200
   // Fan Speed:
191
   // Fan Speed:
201
   //
192
   //
202
-  #if FAN_COUNT > 0
193
+  #if HAS_FAN
203
 
194
 
204
     auto on_fan_update = []{
195
     auto on_fan_update = []{
205
       thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
196
       thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
266
       singlenozzle_item(1);
257
       singlenozzle_item(1);
267
     #endif
258
     #endif
268
 
259
 
269
-  #endif // FAN_COUNT > 0
260
+  #endif // HAS_FAN
270
 
261
 
271
   #if HAS_TEMP_HOTEND
262
   #if HAS_TEMP_HOTEND
272
 
263
 

+ 3
- 3
Marlin/src/lcd/menu/menu_tune.cpp Просмотреть файл

132
   // Bed:
132
   // Bed:
133
   //
133
   //
134
   #if HAS_HEATED_BED
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
   #endif
136
   #endif
137
 
137
 
138
   //
138
   //
139
   // Fan Speed:
139
   // Fan Speed:
140
   //
140
   //
141
-  #if FAN_COUNT > 0
141
+  #if HAS_FAN
142
 
142
 
143
     auto on_fan_update = []{
143
     auto on_fan_update = []{
144
       thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
144
       thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
205
       singlenozzle_item(1);
205
       singlenozzle_item(1);
206
     #endif
206
     #endif
207
 
207
 
208
-  #endif // FAN_COUNT > 0
208
+  #endif // HAS_FAN
209
 
209
 
210
   //
210
   //
211
   // Flow:
211
   // Flow:

+ 2
- 2
Marlin/src/lcd/menu/menu_ubl.cpp Просмотреть файл

128
 void _lcd_ubl_custom_mesh() {
128
 void _lcd_ubl_custom_mesh() {
129
   START_MENU();
129
   START_MENU();
130
   BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
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
   #if HAS_HEATED_BED
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
   #endif
134
   #endif
135
   ACTION_ITEM(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh);
135
   ACTION_ITEM(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh);
136
   END_MENU();
136
   END_MENU();

+ 7
- 7
Marlin/src/module/planner.cpp Просмотреть файл

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

+ 1
- 1
Marlin/src/module/planner.h Просмотреть файл

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

+ 3
- 3
Marlin/src/module/temperature.cpp Просмотреть файл

152
   uint8_t Temperature::chamberfan_speed; // = 0
152
   uint8_t Temperature::chamberfan_speed; // = 0
153
 #endif
153
 #endif
154
 
154
 
155
-#if FAN_COUNT > 0
155
+#if HAS_FAN
156
 
156
 
157
   uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
157
   uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
158
 
158
 
219
 
219
 
220
   #endif
220
   #endif
221
 
221
 
222
-#endif // FAN_COUNT > 0
222
+#endif // HAS_FAN
223
 
223
 
224
 #if WATCH_HOTENDS
224
 #if WATCH_HOTENDS
225
   hotend_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } }
225
   hotend_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } }
400
 
400
 
401
     TERN_(HAS_AUTO_FAN, next_auto_fan_check_ms = next_temp_ms + 2500UL);
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
       SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
404
       SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
405
       TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
405
       TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
406
       return;
406
       return;

+ 4
- 4
Marlin/src/module/temperature.h Просмотреть файл

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

+ 4
- 4
Marlin/src/module/tool_change.cpp Просмотреть файл

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

+ 1
- 1
Marlin/src/module/tool_change.h Просмотреть файл

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

Загрузка…
Отмена
Сохранить