🎨 Minor temp / UI refactor
This commit is contained in:
parent
320b7a9ac3
commit
12d7995a18
|
@ -819,7 +819,7 @@ void idle(const bool no_stepper_sleep/*=false*/) {
|
|||
TERN_(HAS_BEEPER, buzzer.tick());
|
||||
|
||||
// Handle UI input / draw events
|
||||
TERN(DWIN_CREALITY_LCD, dwinUpdate(), ui.update());
|
||||
ui.update();
|
||||
|
||||
// Run i2c Position Encoders
|
||||
#if ENABLED(I2C_POSITION_ENCODERS)
|
||||
|
|
|
@ -55,17 +55,19 @@ void ControllerFan::set_fan_speed(const uint8_t s) {
|
|||
}
|
||||
|
||||
void ControllerFan::update() {
|
||||
static millis_t lastMotorOn = 0, // Last time a motor was turned on
|
||||
nextMotorCheck = 0; // Last time the state was checked
|
||||
static millis_t lastComponentOn = 0, // Last time a stepper, heater, etc. was turned on
|
||||
nextFanCheck = 0; // Last time the state was checked
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, nextMotorCheck)) {
|
||||
nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
|
||||
if (ELAPSED(ms, nextFanCheck)) {
|
||||
nextFanCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
|
||||
|
||||
// If any triggers for the controller fan are true...
|
||||
// - At least one stepper driver is enabled
|
||||
// - The heated bed is enabled
|
||||
// - TEMP_SENSOR_BOARD is reporting >= CONTROLLER_FAN_MIN_BOARD_TEMP
|
||||
// - TEMP_SENSOR_SOC is reporting >= CONTROLLER_FAN_MIN_SOC_TEMP
|
||||
/**
|
||||
* If any triggers for the controller fan are true...
|
||||
* - At least one stepper driver is enabled
|
||||
* - The heated bed (MOSFET) is enabled
|
||||
* - TEMP_SENSOR_BOARD is reporting >= CONTROLLER_FAN_MIN_BOARD_TEMP
|
||||
* - TEMP_SENSOR_SOC is reporting >= CONTROLLER_FAN_MIN_SOC_TEMP
|
||||
*/
|
||||
const ena_mask_t axis_mask = TERN(CONTROLLER_FAN_USE_Z_ONLY, _BV(Z_AXIS), (ena_mask_t)~TERN0(CONTROLLER_FAN_IGNORE_Z, _BV(Z_AXIS)));
|
||||
if ( (stepper.axis_enabled.bits & axis_mask)
|
||||
|| TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)
|
||||
|
@ -75,13 +77,15 @@ void ControllerFan::update() {
|
|||
#ifdef CONTROLLER_FAN_MIN_SOC_TEMP
|
||||
|| thermalManager.wholeDegSoc() >= CONTROLLER_FAN_MIN_SOC_TEMP
|
||||
#endif
|
||||
) lastMotorOn = ms; //... set time to NOW so the fan will turn on
|
||||
) lastComponentOn = ms; //... set time to NOW so the fan will turn on
|
||||
|
||||
// Fan Settings. Set fan > 0:
|
||||
// - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds.
|
||||
// - If System is on idle and idle fan speed settings is activated.
|
||||
/**
|
||||
* Fan Settings. Set fan > 0:
|
||||
* - If AutoMode is on and hot components have been powered for CONTROLLERFAN_IDLE_TIME seconds.
|
||||
* - If System is on idle and idle fan speed settings is activated.
|
||||
*/
|
||||
set_fan_speed(
|
||||
settings.auto_mode && lastMotorOn && PENDING(ms, lastMotorOn + SEC_TO_MS(settings.duration))
|
||||
settings.auto_mode && lastComponentOn && PENDING(ms, lastComponentOn + SEC_TO_MS(settings.duration))
|
||||
? settings.active_speed : settings.idle_speed
|
||||
);
|
||||
|
||||
|
|
|
@ -1090,6 +1090,10 @@
|
|||
#define HAS_DISPLAY 1
|
||||
#endif
|
||||
|
||||
#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD)
|
||||
#define HAS_UI_UPDATE 1
|
||||
#endif
|
||||
|
||||
#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT && !IS_DWIN_MARLINUI
|
||||
#define HAS_LCDPRINT 1
|
||||
#endif
|
||||
|
|
|
@ -4082,6 +4082,8 @@ void dwinUpdate() {
|
|||
dwinHandleScreen(); // Rotary encoder update
|
||||
}
|
||||
|
||||
void MarlinUI::update() { dwinUpdate(); }
|
||||
|
||||
void eachMomentUpdate() {
|
||||
static millis_t next_var_update_ms = 0, next_rts_update_ms = 0;
|
||||
|
||||
|
|
|
@ -505,9 +505,10 @@ public:
|
|||
template<typename... Args>
|
||||
static void status_printf(int8_t level, FSTR_P const ffmt, Args... more) { status_printf_P(level, FTOP(ffmt), more...); }
|
||||
|
||||
#if HAS_DISPLAY
|
||||
// Periodic or as-needed display update
|
||||
static void update() IF_DISABLED(HAS_UI_UPDATE, {});
|
||||
|
||||
static void update();
|
||||
#if HAS_DISPLAY
|
||||
|
||||
static void abort_print();
|
||||
static void pause_print();
|
||||
|
@ -628,7 +629,6 @@ public:
|
|||
|
||||
#else // No LCD
|
||||
|
||||
static void update() {}
|
||||
static void kill_screen(FSTR_P const, FSTR_P const) {}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -490,8 +490,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|||
#if HAS_HEATED_BED
|
||||
bed_info_t Temperature::temp_bed; // = { 0 }
|
||||
// Init min and max temp with extreme values to prevent false errors during startup
|
||||
raw_adc_t Temperature::mintemp_raw_BED = TEMP_SENSOR_BED_RAW_LO_TEMP,
|
||||
Temperature::maxtemp_raw_BED = TEMP_SENSOR_BED_RAW_HI_TEMP;
|
||||
temp_raw_range_t Temperature::temp_sensor_range_bed = { TEMP_SENSOR_BED_RAW_LO_TEMP, TEMP_SENSOR_BED_RAW_HI_TEMP };
|
||||
#if WATCH_BED
|
||||
bed_watch_t Temperature::watch_bed; // = { 0 }
|
||||
#endif
|
||||
|
@ -505,8 +504,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|||
#if HAS_HEATED_CHAMBER
|
||||
millis_t next_cool_check_ms = 0;
|
||||
celsius_float_t old_temp = 9999;
|
||||
raw_adc_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP,
|
||||
Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP;
|
||||
temp_raw_range_t Temperature::temp_sensor_range_chamber = { TEMP_SENSOR_CHAMBER_RAW_LO_TEMP, TEMP_SENSOR_CHAMBER_RAW_HI_TEMP };
|
||||
#if WATCH_CHAMBER
|
||||
chamber_watch_t Temperature::watch_chamber; // = { 0 }
|
||||
#endif
|
||||
|
@ -522,8 +520,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|||
bool flag_cooler_state;
|
||||
//bool flag_cooler_excess = false;
|
||||
celsius_float_t previous_temp = 9999;
|
||||
raw_adc_t Temperature::mintemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_LO_TEMP,
|
||||
Temperature::maxtemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_HI_TEMP;
|
||||
temp_raw_range_t Temperature::temp_sensor_range_cooler = { TEMP_SENSOR_COOLER_RAW_LO_TEMP, TEMP_SENSOR_COOLER_RAW_HI_TEMP };
|
||||
#if WATCH_COOLER
|
||||
cooler_watch_t Temperature::watch_cooler; // = { 0 }
|
||||
#endif
|
||||
|
@ -538,8 +535,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|||
#if HAS_TEMP_BOARD
|
||||
board_info_t Temperature::temp_board; // = { 0 }
|
||||
#if ENABLED(THERMAL_PROTECTION_BOARD)
|
||||
raw_adc_t Temperature::mintemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_LO_TEMP,
|
||||
Temperature::maxtemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_HI_TEMP;
|
||||
temp_raw_range_t Temperature::temp_sensor_range_board = { TEMP_SENSOR_BOARD_RAW_LO_TEMP, TEMP_SENSOR_BOARD_RAW_HI_TEMP };
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -700,7 +696,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_STARTED));
|
||||
TERN_(PROUI_PID_TUNE, dwinPidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START));
|
||||
|
||||
if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) {
|
||||
if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, hotend_max_target(heater_id))) {
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
|
||||
TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TEMP_TOO_HIGH));
|
||||
|
@ -718,7 +714,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
const celsius_float_t start_temp = GHV(degChamber(), degBed(), degHotend(heater_id));
|
||||
LEDColor color = ONHEATINGSTART();
|
||||
const LEDColor oldcolor = ONHEATINGSTART();
|
||||
#endif
|
||||
|
||||
TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = false);
|
||||
|
@ -882,7 +878,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||
if (set_result)
|
||||
GHV(_set_chamber_pid(tune_pid), _set_bed_pid(tune_pid), _set_hotend_pid(heater_id, tune_pid));
|
||||
|
||||
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color));
|
||||
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(oldcolor));
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE));
|
||||
TERN_(PROUI_PID_TUNE, dwinPidTuning(AUTOTUNE_DONE));
|
||||
|
@ -894,13 +890,13 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||
hal.idletask();
|
||||
|
||||
// Run UI update
|
||||
TERN(DWIN_CREALITY_LCD, dwinUpdate(), ui.update());
|
||||
ui.update();
|
||||
}
|
||||
wait_for_heatup = false;
|
||||
|
||||
disable_all_heaters();
|
||||
|
||||
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color));
|
||||
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(oldcolor));
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE));
|
||||
TERN_(PROUI_PID_TUNE, dwinPidTuning(AUTOTUNE_DONE));
|
||||
|
@ -1143,7 +1139,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||
}
|
||||
|
||||
Temperature::MPC_autotuner::MeasurementState Temperature::MPC_autotuner::housekeeping() {
|
||||
const millis_t report_interval_ms = 1000UL;
|
||||
constexpr millis_t report_interval_ms = 1000UL;
|
||||
curr_time_ms = millis();
|
||||
|
||||
if (updateTemperaturesIfReady()) { // temp sample ready
|
||||
|
@ -1158,7 +1154,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||
}
|
||||
|
||||
hal.idletask();
|
||||
TERN(DWIN_CREALITY_LCD, dwinUpdate(), ui.update());
|
||||
ui.update();
|
||||
|
||||
if (!wait_for_heatup) {
|
||||
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED);
|
||||
|
@ -1834,12 +1830,18 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T
|
|||
// Check if temperature is within the correct band
|
||||
if (WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP)) {
|
||||
#if ENABLED(BED_LIMIT_SWITCHING)
|
||||
|
||||
// Range-limited "bang-bang" bed heating
|
||||
if (temp_bed.is_above_target(BED_HYSTERESIS))
|
||||
temp_bed.soft_pwm_amount = 0;
|
||||
else if (temp_bed.is_below_target(BED_HYSTERESIS))
|
||||
temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1;
|
||||
|
||||
#else // !PIDTEMPBED && !BED_LIMIT_SWITCHING
|
||||
|
||||
// Simple (noisy) "bang-bang" bed heating
|
||||
temp_bed.soft_pwm_amount = temp_bed.is_below_target() ? MAX_BED_POWER >> 1 : 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
@ -2632,31 +2634,8 @@ void Temperature::updateTemperaturesFromRawValues() {
|
|||
TERN_(HAS_POWER_MONITOR, power_monitor.capture_values());
|
||||
|
||||
#if HAS_HOTEND
|
||||
static constexpr int8_t temp_dir[HOTENDS] = {
|
||||
#if TEMP_SENSOR_IS_ANY_MAX_TC(0)
|
||||
0
|
||||
#else
|
||||
TEMPDIR(0)
|
||||
#endif
|
||||
#if HAS_MULTI_HOTEND
|
||||
#if TEMP_SENSOR_IS_ANY_MAX_TC(1)
|
||||
, 0
|
||||
#else
|
||||
, TEMPDIR(1)
|
||||
#endif
|
||||
#endif
|
||||
#if HOTENDS > 2
|
||||
#if TEMP_SENSOR_IS_ANY_MAX_TC(2)
|
||||
, 0
|
||||
#else
|
||||
, TEMPDIR(2)
|
||||
#endif
|
||||
#endif
|
||||
#if HOTENDS > 3
|
||||
#define _TEMPDIR(N) , TEMPDIR(N)
|
||||
REPEAT_S(3, HOTENDS, _TEMPDIR)
|
||||
#endif
|
||||
};
|
||||
#define _TEMPDIR(N) TEMP_SENSOR_IS_ANY_MAX_TC(N) ? 0 : TEMPDIR(N),
|
||||
static constexpr int8_t temp_dir[HOTENDS] = { REPEAT(HOTENDS, _TEMPDIR) };
|
||||
|
||||
HOTEND_LOOP() {
|
||||
const raw_adc_t r = temp_hotend[e].getraw();
|
||||
|
@ -2683,31 +2662,37 @@ void Temperature::updateTemperaturesFromRawValues() {
|
|||
|
||||
#endif // HAS_HOTEND
|
||||
|
||||
#define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B)))
|
||||
#if ENABLED(THERMAL_PROTECTION_BED)
|
||||
if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) MAXTEMP_ERROR(H_BED, temp_bed.celsius);
|
||||
if (temp_bed.target > 0 && !is_bed_preheating() && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) MINTEMP_ERROR(H_BED, temp_bed.celsius);
|
||||
if (TP_CMP(BED, temp_bed.getraw(), temp_sensor_range_bed.raw_max))
|
||||
MAXTEMP_ERROR(H_BED, temp_bed.celsius);
|
||||
if (temp_bed.target > 0 && !is_bed_preheating() && TP_CMP(BED, temp_sensor_range_bed.raw_min, temp_bed.getraw()))
|
||||
MINTEMP_ERROR(H_BED, temp_bed.celsius);
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER)
|
||||
if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) MAXTEMP_ERROR(H_CHAMBER, temp_chamber.celsius);
|
||||
if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) MINTEMP_ERROR(H_CHAMBER, temp_chamber.celsius);
|
||||
if (TP_CMP(CHAMBER, temp_chamber.getraw(), temp_sensor_range_chamber.raw_max))
|
||||
MAXTEMP_ERROR(H_CHAMBER, temp_chamber.celsius);
|
||||
if (temp_chamber.target > 0 && TP_CMP(CHAMBER, temp_sensor_range_chamber.raw_min, temp_chamber.getraw()))
|
||||
MINTEMP_ERROR(H_CHAMBER, temp_chamber.celsius);
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_COOLER, THERMAL_PROTECTION_COOLER)
|
||||
if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) MAXTEMP_ERROR(H_COOLER, temp_cooler.celsius);
|
||||
if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) MINTEMP_ERROR(H_COOLER, temp_cooler.celsius);
|
||||
if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), temp_sensor_range_cooler.raw_max))
|
||||
MAXTEMP_ERROR(H_COOLER, temp_cooler.celsius);
|
||||
if (TP_CMP(COOLER, temp_sensor_range_cooler.raw_min, temp_cooler.getraw()))
|
||||
MINTEMP_ERROR(H_COOLER, temp_cooler.celsius);
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD)
|
||||
if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) MAXTEMP_ERROR(H_BOARD, temp_board.celsius);
|
||||
if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) MINTEMP_ERROR(H_BOARD, temp_board.celsius);
|
||||
if (TP_CMP(BOARD, temp_board.getraw(), temp_sensor_range_board.raw_max))
|
||||
MAXTEMP_ERROR(H_BOARD, temp_board.celsius);
|
||||
if (TP_CMP(BOARD, temp_sensor_range_board.raw_min, temp_board.getraw()))
|
||||
MINTEMP_ERROR(H_BOARD, temp_board.celsius);
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_TEMP_SOC, THERMAL_PROTECTION_SOC)
|
||||
if (TP_CMP(SOC, temp_soc.getraw(), maxtemp_raw_SOC)) MAXTEMP_ERROR(H_SOC, temp_soc.celsius);
|
||||
#endif
|
||||
#undef TP_CMP
|
||||
|
||||
} // Temperature::updateTemperaturesFromRawValues
|
||||
|
||||
|
@ -2733,7 +2718,6 @@ void Temperature::init() {
|
|||
|
||||
TERN_(PROBING_HEATERS_OFF, paused_for_probing = false);
|
||||
|
||||
|
||||
// Init (and disable) SPI thermocouples
|
||||
#if TEMP_SENSOR_IS_ANY_MAX_TC(0) && PIN_EXISTS(TEMP_0_CS)
|
||||
OUT_WRITE(TEMP_0_CS_PIN, HIGH);
|
||||
|
@ -3051,23 +3035,31 @@ void Temperature::init() {
|
|||
|
||||
// TODO: combine these into the macros above
|
||||
#if HAS_HEATED_BED
|
||||
while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_bed(maxtemp_raw_BED) > BED_MAXTEMP) maxtemp_raw_BED -= TEMPDIR(BED) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_bed(temp_sensor_range_bed.raw_min) < BED_MINTEMP)
|
||||
temp_sensor_range_bed.raw_min += TEMPDIR(BED) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_bed(temp_sensor_range_bed.raw_max) > BED_MAXTEMP)
|
||||
temp_sensor_range_bed.raw_max -= TEMPDIR(BED) * (OVERSAMPLENR);
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_CHAMBER
|
||||
while (analog_to_celsius_chamber(mintemp_raw_CHAMBER) < CHAMBER_MINTEMP) mintemp_raw_CHAMBER += TEMPDIR(CHAMBER) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_chamber(maxtemp_raw_CHAMBER) > CHAMBER_MAXTEMP) maxtemp_raw_CHAMBER -= TEMPDIR(CHAMBER) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_chamber(temp_sensor_range_chamber.raw_min) < CHAMBER_MINTEMP)
|
||||
temp_sensor_range_chamber.raw_min += TEMPDIR(CHAMBER) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_chamber(temp_sensor_range_chamber.raw_max) > CHAMBER_MAXTEMP)
|
||||
temp_sensor_range_chamber.raw_max -= TEMPDIR(CHAMBER) * (OVERSAMPLENR);
|
||||
#endif
|
||||
|
||||
#if HAS_COOLER
|
||||
while (analog_to_celsius_cooler(mintemp_raw_COOLER) > COOLER_MINTEMP) mintemp_raw_COOLER += TEMPDIR(COOLER) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_cooler(maxtemp_raw_COOLER) < COOLER_MAXTEMP) maxtemp_raw_COOLER -= TEMPDIR(COOLER) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_cooler(temp_sensor_range_cooler.raw_min) > COOLER_MINTEMP)
|
||||
temp_sensor_range_cooler.raw_min += TEMPDIR(COOLER) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_cooler(temp_sensor_range_cooler.raw_max) < COOLER_MAXTEMP)
|
||||
temp_sensor_range_cooler.raw_max -= TEMPDIR(COOLER) * (OVERSAMPLENR);
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD)
|
||||
while (analog_to_celsius_board(mintemp_raw_BOARD) < BOARD_MINTEMP) mintemp_raw_BOARD += TEMPDIR(BOARD) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_board(maxtemp_raw_BOARD) > BOARD_MAXTEMP) maxtemp_raw_BOARD -= TEMPDIR(BOARD) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_board(temp_sensor_range_board.raw_min) < BOARD_MINTEMP)
|
||||
temp_sensor_range_board.raw_min += TEMPDIR(BOARD) * (OVERSAMPLENR);
|
||||
while (analog_to_celsius_board(temp_sensor_range_board.raw_max) > BOARD_MAXTEMP)
|
||||
temp_sensor_range_board.raw_max -= TEMPDIR(BOARD) * (OVERSAMPLENR);
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_TEMP_SOC, THERMAL_PROTECTION_SOC)
|
||||
|
|
|
@ -522,6 +522,9 @@ struct HeaterWatch {
|
|||
typedef struct HeaterWatch<WATCH_COOLER_TEMP_INCREASE, TEMP_COOLER_HYSTERESIS, WATCH_COOLER_TEMP_PERIOD> cooler_watch_t;
|
||||
#endif
|
||||
|
||||
// Just raw temperature sensor ranges
|
||||
typedef struct { raw_adc_t raw_min, raw_max; } temp_raw_range_t;
|
||||
|
||||
// Temperature sensor read value ranges
|
||||
typedef struct { raw_adc_t raw_min, raw_max; celsius_t mintemp, maxtemp; } temp_range_t;
|
||||
|
||||
|
@ -727,6 +730,7 @@ class Temperature {
|
|||
#endif
|
||||
|
||||
#if HAS_HOTEND
|
||||
// Sensor ranges, not user-configured
|
||||
static temp_range_t temp_range[HOTENDS];
|
||||
#endif
|
||||
|
||||
|
@ -737,7 +741,7 @@ class Temperature {
|
|||
#if DISABLED(PIDTEMPBED)
|
||||
static millis_t next_bed_check_ms;
|
||||
#endif
|
||||
static raw_adc_t mintemp_raw_BED, maxtemp_raw_BED;
|
||||
static temp_raw_range_t temp_sensor_range_bed;
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_CHAMBER
|
||||
|
@ -747,7 +751,7 @@ class Temperature {
|
|||
#if DISABLED(PIDTEMPCHAMBER)
|
||||
static millis_t next_chamber_check_ms;
|
||||
#endif
|
||||
static raw_adc_t mintemp_raw_CHAMBER, maxtemp_raw_CHAMBER;
|
||||
static temp_raw_range_t temp_sensor_range_chamber;
|
||||
#endif
|
||||
|
||||
#if HAS_COOLER
|
||||
|
@ -755,11 +759,11 @@ class Temperature {
|
|||
static cooler_watch_t watch_cooler;
|
||||
#endif
|
||||
static millis_t next_cooler_check_ms, cooler_fan_flush_ms;
|
||||
static raw_adc_t mintemp_raw_COOLER, maxtemp_raw_COOLER;
|
||||
static temp_raw_range_t temp_sensor_range_cooler;
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD)
|
||||
static raw_adc_t mintemp_raw_BOARD, maxtemp_raw_BOARD;
|
||||
static temp_raw_range_t temp_sensor_range_board;
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_TEMP_SOC, THERMAL_PROTECTION_SOC)
|
||||
|
@ -1194,7 +1198,7 @@ class Temperature {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* Perform auto-tuning for hotend or bed in response to M303
|
||||
* M303 PID auto-tuning for hotends or bed
|
||||
*/
|
||||
#if HAS_PID_HEATING
|
||||
|
||||
|
@ -1219,6 +1223,9 @@ class Temperature {
|
|||
|
||||
#endif // HAS_PID_HEATING
|
||||
|
||||
/**
|
||||
* M306 MPC auto-tuning for hotends
|
||||
*/
|
||||
#if ENABLED(MPC_AUTOTUNE)
|
||||
|
||||
// Utility class to perform MPCTEMP auto tuning measurements
|
||||
|
|
Loading…
Reference in a new issue