Remove ADVANCED_PAUSE_FEATURE requirement for PROBING_HEATERS_OFF (#7000)

* Remove ADVANCED_PAUSE_FEATURE requirement for PROBING_HEATERS_OFF

* Add HEATER_IDLE_HANDLER conditional
This commit is contained in:
Thomas Moore 2017-06-12 00:22:31 -05:00 committed by Scott Lahteine
parent 8326c1c279
commit e47029199e
6 changed files with 14 additions and 20 deletions

View File

@ -653,6 +653,7 @@
#undef PROBING_FANS_OFF
#endif
#define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF)))
#define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF))
/**
* Servos and probes

View File

@ -577,13 +577,6 @@ static_assert(1 >= 0
#error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
#endif
/**
* Advanced Pause is required in order to turn the heaters off during probing
*/
#if (ENABLED(PROBING_HEATERS_OFF) && DISABLED(ADVANCED_PAUSE_FEATURE))
#error "PROBING_HEATERS_OFF requires ADVANCED_PAUSE_FEATURE"
#endif
#else
/**

View File

@ -203,7 +203,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
bool Temperature::paused;
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
millis_t Temperature::heater_idle_timeout_ms[HOTENDS] = { 0 };
bool Temperature::heater_idle_timeout_exceeded[HOTENDS] = { false };
#if HAS_TEMP_BED
@ -558,7 +558,7 @@ float Temperature::get_pid_output(int e) {
pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX];
dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX];
temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX];
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
if (heater_idle_timeout_exceeded[HOTEND_INDEX]) {
pid_output = 0;
pid_reset[HOTEND_INDEX] = true;
@ -570,7 +570,7 @@ float Temperature::get_pid_output(int e) {
pid_reset[HOTEND_INDEX] = true;
}
else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
|| heater_idle_timeout_exceeded[HOTEND_INDEX]
#endif
) {
@ -633,7 +633,7 @@ float Temperature::get_pid_output(int e) {
#endif // PID_DEBUG
#else /* PID off */
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
if (heater_idle_timeout_exceeded[HOTEND_INDEX])
pid_output = 0;
else
@ -719,13 +719,13 @@ void Temperature::manage_heater() {
if (current_temperature[0] < max(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0);
#endif
#if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || ENABLED(ADVANCED_PAUSE_FEATURE)
#if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER
millis_t ms = millis();
#endif
HOTEND_LOOP() {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
if (!heater_idle_timeout_exceeded[e] && heater_idle_timeout_ms[e] && ELAPSED(ms, heater_idle_timeout_ms[e]))
heater_idle_timeout_exceeded[e] = true;
#endif
@ -793,7 +793,7 @@ void Temperature::manage_heater() {
#if HAS_TEMP_BED
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
if (!bed_idle_timeout_exceeded && bed_idle_timeout_ms && ELAPSED(ms, bed_idle_timeout_ms))
bed_idle_timeout_exceeded = true;
#endif
@ -802,7 +802,7 @@ void Temperature::manage_heater() {
thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS);
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
if (bed_idle_timeout_exceeded)
{
soft_pwm_amount_bed = 0;
@ -1294,7 +1294,7 @@ void Temperature::init() {
int heater_index = heater_id >= 0 ? heater_id : HOTENDS;
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
// If the heater idle timeout expires, restart
if (heater_id >= 0 && heater_idle_timeout_exceeded[heater_id]) {
*state = TRInactive;

View File

@ -262,7 +262,7 @@ class Temperature {
static bool paused;
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
static millis_t heater_idle_timeout_ms[HOTENDS];
static bool heater_idle_timeout_exceeded[HOTENDS];
#if HAS_TEMP_BED
@ -476,7 +476,7 @@ class Temperature {
static bool is_paused() { return paused; }
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
static void start_heater_idle_timer(uint8_t e, millis_t timeout_ms) {
#if HOTENDS == 1
UNUSED(e);

View File

@ -357,7 +357,7 @@ FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, cons
#endif
if (PAGE_UNDER(7)) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
#if HAS_TEMP_BED
thermalManager.is_bed_idle()

View File

@ -600,7 +600,7 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co
lcd.print(itostr3(t1 + 0.5));
lcd.print('/');
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if HEATER_IDLE_HANDLER
const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
#if HAS_TEMP_BED
thermalManager.is_bed_idle()