瀏覽代碼

Apply more HAS_HOTEND

Scott Lahteine 5 年之前
父節點
當前提交
01c646a892

+ 1
- 1
Marlin/src/feature/power.cpp 查看文件

@@ -74,7 +74,7 @@ bool Power::is_power_needed() {
74 74
   HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true;
75 75
   if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) return true;
76 76
 
77
-  #if HOTENDS && AUTO_POWER_E_TEMP
77
+  #if HAS_HOTEND && AUTO_POWER_E_TEMP
78 78
     HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true;
79 79
   #endif
80 80
 

+ 1
- 1
Marlin/src/gcode/gcode.cpp 查看文件

@@ -544,7 +544,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
544 544
       case 120: M120(); break;                                    // M120: Enable endstops
545 545
       case 121: M121(); break;                                    // M121: Disable endstops
546 546
 
547
-      #if HOTENDS && HAS_LCD_MENU
547
+      #if HAS_HOTEND && HAS_LCD_MENU
548 548
         case 145: M145(); break;                                  // M145: Set material heatup parameters
549 549
       #endif
550 550
 

+ 1
- 1
Marlin/src/gcode/gcode.h 查看文件

@@ -602,7 +602,7 @@ private:
602 602
     static void M191();
603 603
   #endif
604 604
 
605
-  #if HOTENDS && HAS_LCD_MENU
605
+  #if HAS_HOTEND && HAS_LCD_MENU
606 606
     static void M145();
607 607
   #endif
608 608
 

+ 1
- 1
Marlin/src/gcode/lcd/M145.cpp 查看文件

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if HOTENDS && HAS_LCD_MENU
25
+#if HAS_HOTEND && HAS_LCD_MENU
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../lcd/ultralcd.h"

+ 1
- 1
Marlin/src/inc/Conditionals_post.h 查看文件

@@ -1653,7 +1653,7 @@
1653 1653
   #define HAS_TEMP_ADC_CHAMBER 1
1654 1654
 #endif
1655 1655
 
1656
-#if HOTENDS && EITHER(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675)
1656
+#if HAS_HOTEND && EITHER(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675)
1657 1657
   #define HAS_TEMP_HOTEND 1
1658 1658
 #endif
1659 1659
 #define HAS_TEMP_BED        HAS_TEMP_ADC_BED

+ 1
- 1
Marlin/src/lcd/dogm/dogm_Statusscreen.h 查看文件

@@ -1749,7 +1749,7 @@
1749 1749
 #if HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)
1750 1750
   #define DO_DRAW_FAN 1
1751 1751
 #endif
1752
-#if HOTENDS && ENABLED(STATUS_HOTEND_ANIM)
1752
+#if BOTH(HAS_HOTEND, STATUS_HOTEND_ANIM)
1753 1753
   #define ANIM_HOTEND 1
1754 1754
 #endif
1755 1755
 #if BOTH(DO_DRAW_BED, STATUS_BED_ANIM)

+ 22
- 54
Marlin/src/lcd/extui/ui_api.cpp 查看文件

@@ -169,7 +169,7 @@ namespace ExtUI {
169 169
   }
170 170
 
171 171
   void enableHeater(const extruder_t extruder) {
172
-    #if HOTENDS && HEATER_IDLE_HANDLER
172
+    #if HAS_HOTEND && HEATER_IDLE_HANDLER
173 173
       thermalManager.reset_hotend_idle_timer(extruder - E0);
174 174
     #else
175 175
       UNUSED(extruder);
@@ -234,7 +234,7 @@ namespace ExtUI {
234 234
 
235 235
   bool isHeaterIdle(const extruder_t extruder) {
236 236
     return false
237
-      #if HOTENDS && HEATER_IDLE_HANDLER
237
+      #if HAS_HOTEND && HEATER_IDLE_HANDLER
238 238
         || thermalManager.hotend_idle[extruder - E0].timed_out
239 239
       #else
240 240
         ; UNUSED(extruder)
@@ -746,13 +746,13 @@ namespace ExtUI {
746 746
   #endif
747 747
 
748 748
   float getZOffset_mm() {
749
-    #if HAS_BED_PROBE
750
-      return probe.offset.z;
751
-    #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
752
-      return (planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]);
753
-    #else
754
-      return 0.0;
755
-    #endif
749
+    return (0.0f
750
+      #if HAS_BED_PROBE
751
+        + probe.offset.z
752
+      #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
753
+        + planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
754
+      #endif
755
+    );
756 756
   }
757 757
 
758 758
   void setZOffset_mm(const float value) {
@@ -857,17 +857,9 @@ namespace ExtUI {
857 857
   float getFeedrate_percent() { return feedrate_percentage; }
858 858
 
859 859
   #if ENABLED(PIDTEMP)
860
-    float getPIDValues_Kp(const extruder_t tool) {
861
-      return PID_PARAM(Kp, tool);
862
-    }
863
-
864
-    float getPIDValues_Ki(const extruder_t tool) {
865
-      return unscalePID_i(PID_PARAM(Ki, tool));
866
-    }
867
-
868
-    float getPIDValues_Kd(const extruder_t tool) {
869
-      return unscalePID_d(PID_PARAM(Kd, tool));
870
-    }
860
+    float getPIDValues_Kp(const extruder_t tool) { return PID_PARAM(Kp, tool); }
861
+    float getPIDValues_Ki(const extruder_t tool) { return unscalePID_i(PID_PARAM(Ki, tool)); }
862
+    float getPIDValues_Kd(const extruder_t tool) { return unscalePID_d(PID_PARAM(Kd, tool)); }
871 863
 
872 864
     void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
873 865
       thermalManager.temp_hotend[tool].pid.Kp = p;
@@ -876,23 +868,15 @@ namespace ExtUI {
876 868
       thermalManager.updatePID();
877 869
     }
878 870
 
879
-    void startPIDTune(const float temp, extruder_t tool){
871
+    void startPIDTune(const float temp, extruder_t tool) {
880 872
       thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
881 873
     }
882 874
   #endif
883 875
 
884 876
   #if ENABLED(PIDTEMPBED)
885
-    float getBedPIDValues_Kp() {
886
-      return thermalManager.temp_bed.pid.Kp;
887
-    }
888
-
889
-    float getBedPIDValues_Ki() {
890
-      return unscalePID_i(thermalManager.temp_bed.pid.Ki);
891
-    }
892
-
893
-    float getBedPIDValues_Kd() {
894
-      return unscalePID_d(thermalManager.temp_bed.pid.Kd);
895
-    }
877
+    float getBedPIDValues_Kp() { return thermalManager.temp_bed.pid.Kp; }
878
+    float getBedPIDValues_Ki() { return unscalePID_i(thermalManager.temp_bed.pid.Ki); }
879
+    float getBedPIDValues_Kd() { return unscalePID_d(thermalManager.temp_bed.pid.Kd); }
896 880
 
897 881
     void setBedPIDValues(const float p, const float i, const float d) {
898 882
       thermalManager.temp_bed.pid.Kp = p;
@@ -906,20 +890,12 @@ namespace ExtUI {
906 890
     }
907 891
   #endif
908 892
 
909
-  void injectCommands_P(PGM_P const gcode) {
910
-    queue.inject_P(gcode);
911
-  }
893
+  void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); }
912 894
 
913 895
   bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); }
914 896
 
915
-  bool isAxisPositionKnown(const axis_t axis) {
916
-    return TEST(axis_known_position, axis);
917
-  }
918
-
919
-  bool isAxisPositionKnown(const extruder_t) {
920
-    return TEST(axis_known_position, E_AXIS);
921
-  }
922
-
897
+  bool isAxisPositionKnown(const axis_t axis) { return TEST(axis_known_position, axis); }
898
+  bool isAxisPositionKnown(const extruder_t) { return TEST(axis_known_position, E_AXIS); }
923 899
   bool isPositionKnown() { return all_axes_known(); }
924 900
   bool isMachineHomed() { return all_axes_homed(); }
925 901
 
@@ -1008,17 +984,9 @@ namespace ExtUI {
1008 984
     return IFSD(IS_SD_INSERTED() && card.isMounted(), false);
1009 985
   }
1010 986
 
1011
-  void pausePrint() {
1012
-    ui.pause_print();
1013
-  }
1014
-
1015
-  void resumePrint() {
1016
-    ui.resume_print();
1017
-  }
1018
-
1019
-  void stopPrint() {
1020
-    ui.abort_print();
1021
-  }
987
+  void pausePrint() { ui.pause_print(); }
988
+  void resumePrint() { ui.resume_print(); }
989
+  void stopPrint() { ui.abort_print(); }
1022 990
 
1023 991
   void onUserConfirmRequired_P(PGM_P const pstr) {
1024 992
     char msg[strlen_P(pstr) + 1];

+ 4
- 4
Marlin/src/module/configuration_store.cpp 查看文件

@@ -799,7 +799,7 @@ void MarlinSettings::postprocess() {
799 799
     {
800 800
       _FIELD_TEST(ui_preheat_hotend_temp);
801 801
 
802
-      #if HOTENDS && HAS_LCD_MENU
802
+      #if HAS_HOTEND && HAS_LCD_MENU
803 803
         const int16_t (&ui_preheat_hotend_temp)[2]  = ui.preheat_hotend_temp,
804 804
                       (&ui_preheat_bed_temp)[2]     = ui.preheat_bed_temp;
805 805
         const uint8_t (&ui_preheat_fan_speed)[2]    = ui.preheat_fan_speed;
@@ -1649,7 +1649,7 @@ void MarlinSettings::postprocess() {
1649 1649
       {
1650 1650
         _FIELD_TEST(ui_preheat_hotend_temp);
1651 1651
 
1652
-        #if HOTENDS && HAS_LCD_MENU
1652
+        #if HAS_HOTEND && HAS_LCD_MENU
1653 1653
           int16_t (&ui_preheat_hotend_temp)[2]  = ui.preheat_hotend_temp,
1654 1654
                   (&ui_preheat_bed_temp)[2]     = ui.preheat_bed_temp;
1655 1655
           uint8_t (&ui_preheat_fan_speed)[2]    = ui.preheat_fan_speed;
@@ -2557,7 +2557,7 @@ void MarlinSettings::reset() {
2557 2557
   // Preheat parameters
2558 2558
   //
2559 2559
 
2560
-  #if HOTENDS && HAS_LCD_MENU
2560
+  #if HAS_HOTEND && HAS_LCD_MENU
2561 2561
     ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND;
2562 2562
     ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND;
2563 2563
     ui.preheat_bed_temp[0] = PREHEAT_1_TEMP_BED;
@@ -3077,7 +3077,7 @@ void MarlinSettings::reset() {
3077 3077
 
3078 3078
     #endif // [XYZ]_DUAL_ENDSTOPS
3079 3079
 
3080
-    #if HOTENDS && HAS_LCD_MENU
3080
+    #if HAS_HOTEND && HAS_LCD_MENU
3081 3081
 
3082 3082
       CONFIG_ECHO_HEADING("Material heatup parameters:");
3083 3083
       LOOP_L_N(i, COUNT(ui.preheat_hotend_temp)) {

+ 2
- 2
Marlin/src/module/temperature.cpp 查看文件

@@ -2386,7 +2386,7 @@ void Temperature::tick() {
2386 2386
 
2387 2387
   #if DISABLED(SLOW_PWM_HEATERS)
2388 2388
 
2389
-    #if HOTENDS || HAS_HEATED_BED || HAS_HEATED_CHAMBER
2389
+    #if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
2390 2390
       constexpr uint8_t pwm_mask =
2391 2391
         #if ENABLED(SOFT_PWM_DITHER)
2392 2392
           _BV(SOFT_PWM_SCALE) - 1
@@ -2931,7 +2931,7 @@ void Temperature::tick() {
2931 2931
 
2932 2932
   #endif // AUTO_REPORT_TEMPERATURES
2933 2933
 
2934
-  #if HOTENDS && HAS_DISPLAY
2934
+  #if HAS_HOTEND && HAS_DISPLAY
2935 2935
     void Temperature::set_heating_message(const uint8_t e) {
2936 2936
       const bool heating = isHeatingHotend(e);
2937 2937
       ui.status_printf_P(0,

Loading…
取消
儲存