🐛 Fix fan index for Singlenozzle, chamber fan

Fixes #22512
Followup to #19152, #19519
2.0.x
Scott Lahteine 3 years ago committed by Scott Lahteine
parent a668a9d302
commit fefde2a644

@ -2047,10 +2047,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be Cooler (-5): requires TEMP_COOLER_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be Cooler (-5): requires TEMP_COOLER_PIN"
#endif #endif
#if TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 0 && !PIN_EXISTS(TEMP_0_CS) #if TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0) && !PIN_EXISTS(TEMP_0_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE 0 requires TEMP_0_CS_PIN." #error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E0 requires TEMP_0_CS_PIN."
#elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1 && !PIN_EXISTS(TEMP_1_CS) #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1) && !PIN_EXISTS(TEMP_1_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE 1 requires TEMP_1_CS_PIN." #error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E1 requires TEMP_1_CS_PIN."
#endif #endif
#endif #endif

@ -369,7 +369,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
} }
#endif #endif
TERN_(SINGLENOZZLE, fan = 0); // Always use fan index 0 with SINGLENOZZLE TERN_(SINGLENOZZLE, if (fan < EXTRUDERS) fan = 0); // Always fan 0 for SINGLENOZZLE E fan
if (fan >= FAN_COUNT) return; if (fan >= FAN_COUNT) return;
@ -1461,7 +1461,7 @@ void Temperature::manage_heater() {
fan_chamber_pwm = CHAMBER_FAN_BASE + _MAX((CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target), 0); fan_chamber_pwm = CHAMBER_FAN_BASE + _MAX((CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target), 0);
#endif #endif
NOMORE(fan_chamber_pwm, 225); NOMORE(fan_chamber_pwm, 225);
set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan set_fan_speed(CHAMBER_FAN_INDEX, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan
#endif #endif
#if ENABLED(CHAMBER_VENT) #if ENABLED(CHAMBER_VENT)
@ -1492,7 +1492,7 @@ void Temperature::manage_heater() {
else if (!flag_chamber_off) { else if (!flag_chamber_off) {
#if ENABLED(CHAMBER_FAN) #if ENABLED(CHAMBER_FAN)
flag_chamber_off = true; flag_chamber_off = true;
set_fan_speed(2, 0); set_fan_speed(CHAMBER_FAN_INDEX, 0);
#endif #endif
#if ENABLED(CHAMBER_VENT) #if ENABLED(CHAMBER_VENT)
flag_chamber_excess_heat = false; flag_chamber_excess_heat = false;

Loading…
Cancel
Save