Invariant get_pid_output with HOTENDS < 2
This commit is contained in:
@ -38,6 +38,16 @@
|
||||
#define SOFT_PWM_SCALE 0
|
||||
#endif
|
||||
|
||||
#if HOTENDS == 1
|
||||
#define HOTEND_ARG 0
|
||||
#define HOTEND_INDEX 0
|
||||
#define EXTRUDER_ARG 0
|
||||
#else
|
||||
#define HOTEND_ARG hotend
|
||||
#define HOTEND_INDEX e
|
||||
#define EXTRUDER_ARG active_extruder
|
||||
#endif
|
||||
|
||||
class Temperature {
|
||||
|
||||
public:
|
||||
@ -112,7 +122,12 @@ class Temperature {
|
||||
|
||||
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
|
||||
static float extrude_min_temp;
|
||||
static bool tooColdToExtrude(uint8_t e) { return degHotend(e) < extrude_min_temp; }
|
||||
static bool tooColdToExtrude(uint8_t e) {
|
||||
#if HOTENDS == 1
|
||||
UNUSED(e);
|
||||
#endif
|
||||
return degHotend(HOTEND_INDEX) < extrude_min_temp;
|
||||
}
|
||||
#else
|
||||
static bool tooColdToExtrude(uint8_t e) { UNUSED(e); return false; }
|
||||
#endif
|
||||
@ -230,12 +245,6 @@ class Temperature {
|
||||
//inline so that there is no performance decrease.
|
||||
//deg=degreeCelsius
|
||||
|
||||
#if HOTENDS == 1
|
||||
#define HOTEND_ARG 0
|
||||
#else
|
||||
#define HOTEND_ARG hotend
|
||||
#endif
|
||||
|
||||
static float degHotend(uint8_t hotend) {
|
||||
#if HOTENDS == 1
|
||||
UNUSED(hotend);
|
||||
@ -329,8 +338,8 @@ class Temperature {
|
||||
#if ENABLED(AUTOTEMP)
|
||||
if (planner.autotemp_enabled) {
|
||||
planner.autotemp_enabled = false;
|
||||
if (degTargetHotend(active_extruder) > planner.autotemp_min)
|
||||
setTargetHotend(0, active_extruder);
|
||||
if (degTargetHotend(EXTRUDER_ARG) > planner.autotemp_min)
|
||||
setTargetHotend(0, EXTRUDER_ARG);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user