浏览代码

Apply more HAS_HOTEND

Scott Lahteine 5 年前
父节点
当前提交
01c646a892

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

74
   HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true;
74
   HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true;
75
   if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) return true;
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
     HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true;
78
     HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true;
79
   #endif
79
   #endif
80
 
80
 

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

544
       case 120: M120(); break;                                    // M120: Enable endstops
544
       case 120: M120(); break;                                    // M120: Enable endstops
545
       case 121: M121(); break;                                    // M121: Disable endstops
545
       case 121: M121(); break;                                    // M121: Disable endstops
546
 
546
 
547
-      #if HOTENDS && HAS_LCD_MENU
547
+      #if HAS_HOTEND && HAS_LCD_MENU
548
         case 145: M145(); break;                                  // M145: Set material heatup parameters
548
         case 145: M145(); break;                                  // M145: Set material heatup parameters
549
       #endif
549
       #endif
550
 
550
 

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

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

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

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

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

1653
   #define HAS_TEMP_ADC_CHAMBER 1
1653
   #define HAS_TEMP_ADC_CHAMBER 1
1654
 #endif
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
   #define HAS_TEMP_HOTEND 1
1657
   #define HAS_TEMP_HOTEND 1
1658
 #endif
1658
 #endif
1659
 #define HAS_TEMP_BED        HAS_TEMP_ADC_BED
1659
 #define HAS_TEMP_BED        HAS_TEMP_ADC_BED

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

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

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

169
   }
169
   }
170
 
170
 
171
   void enableHeater(const extruder_t extruder) {
171
   void enableHeater(const extruder_t extruder) {
172
-    #if HOTENDS && HEATER_IDLE_HANDLER
172
+    #if HAS_HOTEND && HEATER_IDLE_HANDLER
173
       thermalManager.reset_hotend_idle_timer(extruder - E0);
173
       thermalManager.reset_hotend_idle_timer(extruder - E0);
174
     #else
174
     #else
175
       UNUSED(extruder);
175
       UNUSED(extruder);
234
 
234
 
235
   bool isHeaterIdle(const extruder_t extruder) {
235
   bool isHeaterIdle(const extruder_t extruder) {
236
     return false
236
     return false
237
-      #if HOTENDS && HEATER_IDLE_HANDLER
237
+      #if HAS_HOTEND && HEATER_IDLE_HANDLER
238
         || thermalManager.hotend_idle[extruder - E0].timed_out
238
         || thermalManager.hotend_idle[extruder - E0].timed_out
239
       #else
239
       #else
240
         ; UNUSED(extruder)
240
         ; UNUSED(extruder)
746
   #endif
746
   #endif
747
 
747
 
748
   float getZOffset_mm() {
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
   void setZOffset_mm(const float value) {
758
   void setZOffset_mm(const float value) {
857
   float getFeedrate_percent() { return feedrate_percentage; }
857
   float getFeedrate_percent() { return feedrate_percentage; }
858
 
858
 
859
   #if ENABLED(PIDTEMP)
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
     void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
864
     void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
873
       thermalManager.temp_hotend[tool].pid.Kp = p;
865
       thermalManager.temp_hotend[tool].pid.Kp = p;
876
       thermalManager.updatePID();
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
       thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
872
       thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
881
     }
873
     }
882
   #endif
874
   #endif
883
 
875
 
884
   #if ENABLED(PIDTEMPBED)
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
     void setBedPIDValues(const float p, const float i, const float d) {
881
     void setBedPIDValues(const float p, const float i, const float d) {
898
       thermalManager.temp_bed.pid.Kp = p;
882
       thermalManager.temp_bed.pid.Kp = p;
906
     }
890
     }
907
   #endif
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
   bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); }
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
   bool isPositionKnown() { return all_axes_known(); }
899
   bool isPositionKnown() { return all_axes_known(); }
924
   bool isMachineHomed() { return all_axes_homed(); }
900
   bool isMachineHomed() { return all_axes_homed(); }
925
 
901
 
1008
     return IFSD(IS_SD_INSERTED() && card.isMounted(), false);
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
   void onUserConfirmRequired_P(PGM_P const pstr) {
991
   void onUserConfirmRequired_P(PGM_P const pstr) {
1024
     char msg[strlen_P(pstr) + 1];
992
     char msg[strlen_P(pstr) + 1];

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

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

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

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

正在加载...
取消
保存