Improve max temp / target

This commit is contained in:
Scott Lahteine
2021-03-19 16:34:10 -05:00
committed by Scott Lahteine
parent df1ef496d1
commit cfa6c7d45b
15 changed files with 47 additions and 52 deletions

View File

@@ -323,7 +323,8 @@ class Temperature {
#if HAS_HOTEND
#define HOTEND_TEMPS (HOTENDS + ENABLED(TEMP_SENSOR_1_AS_REDUNDANT))
static hotend_info_t temp_hotend[HOTEND_TEMPS];
static const uint16_t heater_maxtemp[HOTENDS];
static const uint16_t hotend_maxtemp[HOTENDS];
FORCE_INLINE static uint16_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); }
#endif
TERN_(HAS_HEATED_BED, static bed_info_t temp_bed);
TERN_(HAS_TEMP_PROBE, static probe_info_t temp_probe);
@@ -639,7 +640,7 @@ class Temperature {
start_preheat_time(ee);
#endif
TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on());
temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - HOTEND_OVERSHOOT);
temp_hotend[ee].target = _MIN(celsius, hotend_max_target(ee));
start_watching_hotend(ee);
}
@@ -785,13 +786,7 @@ class Temperature {
#if HAS_COOLER
static void setTargetCooler(const int16_t celsius) {
temp_cooler.target =
#ifdef COOLER_MAXTEMP
_MIN(celsius, COOLER_MAXTEMP - 10)
#else
celsius
#endif
;
temp_cooler.target = constrain(celsius, COOLER_MIN_TARGET, COOLER_MAX_TARGET);
start_watching_cooler();
}
#endif
@@ -878,7 +873,7 @@ class Temperature {
TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e));
#if HAS_LCD_MENU && HAS_TEMPERATURE
static void lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb);
static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb);
#endif
private: