|
|
@ -793,9 +793,16 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { |
|
|
|
inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) { |
|
|
|
marlin_state = MF_KILLED; |
|
|
|
#if USE_BEEPER |
|
|
|
thermalManager.disable_all_heaters(); |
|
|
|
for (uint8_t i = 20; i--;) { |
|
|
|
WRITE(BEEPER_PIN, HIGH); delay(25); |
|
|
|
WRITE(BEEPER_PIN, LOW); delay(80); |
|
|
|
WRITE(BEEPER_PIN, HIGH); |
|
|
|
delay(25); |
|
|
|
watchdog_refresh(); |
|
|
|
WRITE(BEEPER_PIN, LOW); |
|
|
|
delay(40); |
|
|
|
watchdog_refresh(); |
|
|
|
delay(40); |
|
|
|
watchdog_refresh(); |
|
|
|
} |
|
|
|
WRITE(BEEPER_PIN, HIGH); |
|
|
|
#endif |
|
|
@ -820,6 +827,7 @@ void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_ms |
|
|
|
} |
|
|
|
|
|
|
|
disable_all_heaters(); // always disable (even for bogus temp)
|
|
|
|
watchdog_refresh(); |
|
|
|
|
|
|
|
#if BOGUS_TEMPERATURE_GRACE_PERIOD |
|
|
|
const millis_t ms = millis(); |
|
|
@ -923,8 +931,8 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { |
|
|
|
} |
|
|
|
#endif // PID_EXTRUSION_SCALING
|
|
|
|
#if ENABLED(PID_FAN_SCALING) |
|
|
|
if (thermalManager.fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { |
|
|
|
work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * thermalManager.fan_speed[active_extruder]; |
|
|
|
if (fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { |
|
|
|
work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * fan_speed[active_extruder]; |
|
|
|
pid_output += work_pid[ee].Kf; |
|
|
|
} |
|
|
|
//pid_output -= work_pid[ee].Ki;
|
|
|
@ -1243,7 +1251,7 @@ void Temperature::manage_heater() { |
|
|
|
fan_chamber_pwm += (CHAMBER_FAN_FACTOR) * 2; |
|
|
|
#endif |
|
|
|
NOMORE(fan_chamber_pwm, 225); |
|
|
|
thermalManager.set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan
|
|
|
|
set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan
|
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(CHAMBER_VENT) |
|
|
@ -1274,7 +1282,7 @@ void Temperature::manage_heater() { |
|
|
|
else if (!flag_chamber_off) { |
|
|
|
#if ENABLED(CHAMBER_FAN) |
|
|
|
flag_chamber_off = true; |
|
|
|
thermalManager.set_fan_speed(2, 0); |
|
|
|
set_fan_speed(2, 0); |
|
|
|
#endif |
|
|
|
#if ENABLED(CHAMBER_VENT) |
|
|
|
flag_chamber_excess_heat = false; |
|
|
@ -1355,7 +1363,7 @@ void Temperature::manage_heater() { |
|
|
|
user_thermistor_t Temperature::user_thermistor[USER_THERMISTORS]; // Initialized by settings.load()
|
|
|
|
|
|
|
|
void Temperature::reset_user_thermistors() { |
|
|
|
user_thermistor_t user_thermistor[USER_THERMISTORS] = { |
|
|
|
user_thermistor_t default_user_thermistor[USER_THERMISTORS] = { |
|
|
|
#if HEATER_0_USER_THERMISTOR |
|
|
|
{ true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, |
|
|
|
#endif |
|
|
@ -1387,7 +1395,7 @@ void Temperature::manage_heater() { |
|
|
|
{ true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 } |
|
|
|
#endif |
|
|
|
}; |
|
|
|
COPY(thermalManager.user_thermistor, user_thermistor); |
|
|
|
COPY(user_thermistor, default_user_thermistor); |
|
|
|
} |
|
|
|
|
|
|
|
void Temperature::log_user_thermistor(const uint8_t t_index, const bool eprom/*=false*/) { |
|
|
@ -2423,7 +2431,7 @@ void Temperature::readings_ready() { |
|
|
|
|
|
|
|
#endif // HAS_HOTEND
|
|
|
|
|
|
|
|
#if HAS_HEATED_BED |
|
|
|
#if ENABLED(THERMAL_PROTECTION_BED) |
|
|
|
#if TEMPDIR(BED) < 0 |
|
|
|
#define BEDCMP(A,B) ((A)<(B)) |
|
|
|
#else |
|
|
@ -2434,7 +2442,7 @@ void Temperature::readings_ready() { |
|
|
|
if (bed_on && BEDCMP(mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_HEATED_CHAMBER |
|
|
|
#if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) |
|
|
|
#if TEMPDIR(CHAMBER) < 0 |
|
|
|
#define CHAMBERCMP(A,B) ((A)<(B)) |
|
|
|
#else |
|
|
|