diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index ce2a002b2b..0a5e1820c6 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -645,6 +645,15 @@ #endif #define WRITE_FAN_N(n, v) WRITE_FAN##n(v) + + /** + * Heater & Fan Pausing + */ + #if ENABLED(PROBING_FANS_OFF) && FAN_COUNT == 0 + #undef PROBING_FANS_OFF + #endif + #define QUIET_PROBING (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF)) + /** * Servos and probes */ diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4c1a39b8f3..b2f0cc6394 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -584,14 +584,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index e7bf2df73a..a5c2b81c21 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -362,6 +362,10 @@ int16_t code_value_temp_diff(); #if FAN_COUNT > 0 extern int16_t fanSpeeds[FAN_COUNT]; + #if ENABLED(PROBING_FANS_OFF) + extern bool fans_paused; + extern int16_t paused_fanSpeeds[FAN_COUNT]; + #endif #endif #if ENABLED(BARICUDA) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 43639d99a3..6baecec083 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -441,6 +441,10 @@ float soft_endstop_min[XYZ] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, #if FAN_COUNT > 0 int16_t fanSpeeds[FAN_COUNT] = { 0 }; + #if ENABLED(PROBING_FANS_OFF) + bool fans_paused = false; + int16_t paused_fanSpeeds[FAN_COUNT] = { 0 }; + #endif #endif // The active extruder (tool). Set with T command. @@ -2041,6 +2045,35 @@ static void clean_up_after_endstop_or_probe_move() { #endif +#if ENABLED(PROBING_FANS_OFF) + void fans_pause(bool p) { + if (p && fans_paused) { // If called out of order something is wrong + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Fans already paused!"); + return; + } + + if (!p && !fans_paused) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Fans already unpaused!"); + return; + } + + if (p) { + for (uint8_t x = 0;x < FAN_COUNT;x++) { + paused_fanSpeeds[x] = fanSpeeds[x]; + fanSpeeds[x] = 0; + } + } + else { + for (uint8_t x = 0;x < FAN_COUNT;x++) + fanSpeeds[x] = paused_fanSpeeds[x]; + } + + fans_paused = p; + } +#endif + #if HAS_BED_PROBE // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed. @@ -2052,6 +2085,20 @@ static void clean_up_after_endstop_or_probe_move() { #endif #endif + #if QUIET_PROBING + void probing_pause(bool pause) { + #if ENABLED(PROBING_HEATERS_OFF) + thermalManager.pause(pause); + #endif + + #if ENABLED(PROBING_FANS_OFF) + fans_pause(pause); + #endif + + if(pause) safe_delay(25); + } + #endif + #if ENABLED(BLTOUCH) void bltouch_command(int angle) { @@ -2059,51 +2106,6 @@ static void clean_up_after_endstop_or_probe_move() { safe_delay(BLTOUCH_DELAY); } - /** - * BLTouch probes have a Hall effect sensor. The high currents switching - * on and off cause a magnetic field that can affect the repeatability of the - * sensor. So for BLTouch probes, heaters are turned off during the probe, - * then quickly turned back on after the point is sampled. - */ - #if ENABLED(BLTOUCH_HEATERS_OFF) - - void set_heaters_for_bltouch(const bool deploy) { - static bool heaters_were_disabled = false; - static millis_t next_emi_protection = 0; - static int16_t temps_at_entry[HOTENDS]; - - #if HAS_TEMP_BED - static int16_t bed_temp_at_entry; - #endif - - // If called out of order or far apart something is seriously wrong - if (deploy == heaters_were_disabled - || (next_emi_protection && ELAPSED(millis(), next_emi_protection))) - kill(PSTR(MSG_KILLED)); - - if (deploy) { - next_emi_protection = millis() + 20 * 1000UL; - HOTEND_LOOP() { - temps_at_entry[e] = thermalManager.degTargetHotend(e); - thermalManager.setTargetHotend(0, e); - } - #if HAS_TEMP_BED - bed_temp_at_entry = thermalManager.degTargetBed(); - thermalManager.setTargetBed(0); - #endif - } - else { - next_emi_protection = 0; - HOTEND_LOOP() thermalManager.setTargetHotend(temps_at_entry[e], e); - #if HAS_TEMP_BED - thermalManager.setTargetBed(bed_temp_at_entry); - #endif - } - heaters_were_disabled = deploy; - } - - #endif // BLTOUCH_HEATERS_OFF - void set_bltouch_deployed(const bool deploy) { if (deploy && TEST_BLTOUCH()) { // If BL-Touch says it's triggered bltouch_command(BLTOUCH_RESET); // try to reset it. @@ -2118,9 +2120,6 @@ static void clean_up_after_endstop_or_probe_move() { stop(); // punt! } } - #if ENABLED(BLTOUCH_HEATERS_OFF) - set_heaters_for_bltouch(deploy); - #endif bltouch_command(deploy ? BLTOUCH_DEPLOY : BLTOUCH_STOW); @@ -2249,9 +2248,17 @@ static void clean_up_after_endstop_or_probe_move() { set_bltouch_deployed(true); #endif + #if QUIET_PROBING + probing_pause(true); + #endif + // Move down until probe triggered do_blocking_move_to_z(LOGICAL_Z_POSITION(z), MMM_TO_MMS(fr_mm_m)); + #if QUIET_PROBING + probing_pause(false); + #endif + // Retract BLTouch immediately after a probe #if ENABLED(BLTOUCH) set_bltouch_deployed(false); @@ -2809,6 +2816,10 @@ static void do_homing_move(const AxisEnum axis, float distance, float fr_mm_s=0. if (deploy_bltouch) set_bltouch_deployed(true); #endif + #if QUIET_PROBING + if (axis == Z_AXIS) probing_pause(true); + #endif + // Tell the planner we're at Z=0 current_position[axis] = 0; @@ -2825,6 +2836,10 @@ static void do_homing_move(const AxisEnum axis, float distance, float fr_mm_s=0. stepper.synchronize(); + #if QUIET_PROBING + if (axis == Z_AXIS) probing_pause(false); + #endif + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) if (deploy_bltouch) set_bltouch_deployed(false); #endif @@ -6468,6 +6483,7 @@ inline void gcode_M104() { if (code_seen('S')) { const int16_t temp = code_value_temp_abs(); thermalManager.setTargetHotend(temp, target_extruder); + #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); @@ -6663,6 +6679,7 @@ inline void gcode_M109() { if (no_wait_for_cooling || code_seen('R')) { const int16_t temp = code_value_temp_abs(); thermalManager.setTargetHotend(temp, target_extruder); + #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); @@ -6814,6 +6831,7 @@ inline void gcode_M109() { const bool no_wait_for_cooling = code_seen('S'); if (no_wait_for_cooling || code_seen('R')) { thermalManager.setTargetBed(code_value_temp_abs()); + #if ENABLED(PRINTJOB_TIMER_AUTOSTART) if (code_value_temp_abs() > BED_MINTEMP) print_job_timer.start(); @@ -7107,10 +7125,11 @@ inline void gcode_M81() { thermalManager.disable_all_heaters(); stepper.finish_and_disable(); #if FAN_COUNT > 0 - #if FAN_COUNT > 1 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #else - fanSpeeds[0] = 0; + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; + + #if ENABLED(PROBING_FANS_OFF) + fans_paused = false; + ZERO(paused_fanSpeeds); #endif #endif safe_delay(1000); // Wait 1 second before switching off @@ -12087,7 +12106,12 @@ void kill(const char* lcd_msg) { * After a stop the machine may be resumed with M999 */ void stop() { - thermalManager.disable_all_heaters(); + thermalManager.disable_all_heaters(); // 'unpause' taken care of in here + + #if ENABLED(PROBING_FANS_OFF) + if (fans_paused) fans_pause(false); // put things back the way they were + #endif + if (IsRunning()) { Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart SERIAL_ERROR_START; diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index f38780bd26..b029b4b533 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -582,14 +582,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index ec12db1aba..eaf92c943d 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -566,14 +566,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 88c750fb34..506faaf036 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -566,14 +566,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h b/Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h index 0e131869f9..7c39446376 100644 --- a/Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h +++ b/Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h @@ -590,14 +590,23 @@ #define Z_SERVO_ANGLES {40,85} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 02dfe9c4fd..43be117b7d 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -574,14 +574,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 5c81632d88..e40dbb7863 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -577,14 +577,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 914deba96d..d370fc8a7f 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -612,14 +612,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 1a0bd3e036..4b11a6a38d 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -583,14 +583,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 4d04d6ea63..bd27e511b6 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -583,14 +583,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 1b18f8ba9d..d035246251 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -583,14 +583,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 4a109a5c99..023e01653e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -582,14 +582,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 63bc0f3333..251b466891 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -598,14 +598,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 1b3d640a49..117dab65e3 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -603,14 +603,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 39b4ca6b15..48f8708ce1 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -634,14 +634,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4c6ac763bc..c28c8613da 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -574,14 +574,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index a620b80299..e5d040e033 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -583,14 +583,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h index f31c8f9e8c..42f6b3f3e3 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h @@ -651,14 +651,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h index 7e312bfcba..09122c2ac3 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h @@ -658,14 +658,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 0cceaf4c72..aeee57b4dd 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -647,14 +647,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index ff3f5b2867..2bfb11415a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -642,14 +642,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2128469ea5..a5d7161edc 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -641,14 +641,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 479b4e4666..d35301732d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -660,14 +660,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h index 62ccbfefa2..9fda1367ce 100644 --- a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h @@ -569,11 +569,22 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ #define BLTOUCH -#define BLTOUCH_DELAY 500 // (ms) Enable and increase if needed -#define BLTOUCH_HEATERS_OFF // if defined the printer's heaters are turned off during probe event +#if ENABLED(BLTOUCH) + #define BLTOUCH_DELAY 500 // (ms) Enable and increase if needed +#endif + +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 7352784401..dbe6e2e093 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -586,14 +586,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index ec6485eaba..9ce54e88f3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -579,14 +579,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 5deaccf7dd..acf6b11556 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -588,14 +588,23 @@ //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** - * The BLTouch probe is a Hall effect sensor that emulates a servo. + * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - //#define BLTOUCH_HEATERS_OFF // Enable if the probe seems unreliable. Heaters will be disabled for each probe. #endif +/** + * Enable if probing seems unreliable. Heaters and/or fans - consistent with the + * options selected below - will be disabled during probing so as to minimize + * potential EM interference by quieting/silencing the source of the 'noise' (the change + * in current flowing through the wires). This is likely most useful to users of the + * BLTouch probe, but may also help those with inductive or other probe types. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +//#define PROBING_FANS_OFF // Turn fans off when probing + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 7a480b87a9..dbadd06f32 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -204,6 +204,14 @@ uint8_t Temperature::soft_pwm[HOTENDS]; int Temperature::current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only #endif +#if ENABLED(PROBING_HEATERS_OFF) + bool Temperature::paused; + int16_t Temperature::paused_hotend_temps[HOTENDS]; + #if HAS_TEMP_BED + int16_t Temperature::paused_bed_temp; + #endif +#endif + #if HAS_PID_HEATING void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) { @@ -1194,6 +1202,14 @@ void Temperature::init() { #endif } #endif //BED_MAXTEMP + + #if ENABLED(PROBING_HEATERS_OFF) + paused = false; + ZERO(paused_hotend_temps); + #if HAS_TEMP_BED + paused_bed_temp = 0; + #endif + #endif } #if WATCH_HOTENDS @@ -1297,6 +1313,15 @@ void Temperature::disable_all_heaters() { HOTEND_LOOP() setTargetHotend(0, e); setTargetBed(0); + // Unpause and reset everything + #if ENABLED(PROBING_HEATERS_OFF) + paused = false; + ZERO(paused_hotend_temps); + #if HAS_TEMP_BED + paused_bed_temp = 0; + #endif + #endif + // If all heaters go down then for sure our print job has stopped print_job_timer.stop(); @@ -1331,6 +1356,45 @@ void Temperature::disable_all_heaters() { #endif } +#if ENABLED(PROBING_HEATERS_OFF) + void Temperature::pause(bool p) { + if (p && paused) { // If called out of order something is wrong + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Heaters already paused!"); + return; + } + + if (!p && !paused) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Heaters already unpaused!"); + return; + } + + if (p) { + HOTEND_LOOP() { + paused_hotend_temps[e] = degTargetHotend(e); + setTargetHotend(0, e); + } + #if HAS_TEMP_BED + paused_bed_temp = degTargetBed(); + setTargetBed(0); + #endif + } + else { + HOTEND_LOOP() setTargetHotend(paused_hotend_temps[e], e); + #if HAS_TEMP_BED + setTargetBed(paused_bed_temp); + #endif + } + + paused = p; + } + + bool Temperature::ispaused() { + return paused; + } +#endif + #if ENABLED(HEATER_0_USES_MAX6675) #define MAX6675_HEAT_INTERVAL 250u diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 35d80731e2..7fc9926c35 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -259,6 +259,15 @@ class Temperature { static int current_raw_filwidth; //Holds measured filament diameter - one extruder only #endif + #if ENABLED(PROBING_HEATERS_OFF) + static bool paused; + static int16_t paused_hotend_temps[HOTENDS]; + + #if HAS_TEMP_BED + static int16_t paused_bed_temp; + #endif + #endif + public: /** @@ -452,6 +461,11 @@ class Temperature { #endif // BABYSTEPPING + #if ENABLED(PROBING_HEATERS_OFF) + static void pause(bool p); + static bool ispaused(); + #endif + private: static void set_current_temp_raw();