Cooler (for Laser) - M143, M193 (#21255)

This commit is contained in:
Mike La Spina
2021-03-06 14:13:28 -06:00
committed by GitHub
parent 87bef13a4c
commit b95e548ddb
41 changed files with 1041 additions and 125 deletions

View File

@ -176,6 +176,7 @@ namespace ExtUI {
case BED: thermalManager.reset_bed_idle_timer(); return;
#endif
TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return); // Chamber has no idle timer
TERN_(HAS_COOLER, case COOLER: return); // Cooler has no idle timer
default:
TERN_(HAS_HOTEND, thermalManager.reset_hotend_idle_timer(heater - H0));
break;
@ -904,22 +905,23 @@ namespace ExtUI {
value *= TOUCH_UI_LCD_TEMP_SCALING;
#endif
enableHeater(heater);
#if HAS_HEATED_CHAMBER
if (heater == CHAMBER)
thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAXTEMP - 10)));
else
#endif
#if HAS_HEATED_BED
if (heater == BED)
thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAX_TARGET)));
else
#endif
{
switch (heater) {
#if HAS_HEATED_CHAMBER
case CHAMBER: thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAXTEMP - 10))); break;
#endif
#if HAS_COOLER
case COOLER: thermalManager.setTargetCooler(LROUND(constrain(value, 0, COOLER_MAXTEMP))); break;
#endif
#if HAS_HEATED_BED
case BED: thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAX_TARGET))); break;
#endif
default: {
#if HAS_HOTEND
const int16_t e = heater - H0;
thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT)), e);
#endif
}
} break;
}
}
void setTargetTemp_celsius(float value, const extruder_t extruder) {

View File

@ -55,7 +55,7 @@ namespace ExtUI {
enum axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4 };
enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 };
enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER };
enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER };
enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 };
enum result_t : uint8_t { PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE };