Safe Z homing for Power Loss Recovery (#16909)

This commit is contained in:
Nick
2021-03-01 10:23:10 +00:00
committed by GitHub
parent 2b9842e094
commit e66e51fa6d
6 changed files with 39 additions and 21 deletions

View File

@ -340,7 +340,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
* - If a preheat input is higher than the current target, raise the target temperature.
* - If a preheat input is higher than the current temperature, wait for stabilization.
*/
void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) {
void Probe::preheat_for_probing(const int16_t hotend_temp, const int16_t bed_temp) {
#if HAS_HOTEND && (PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP)
#define WAIT_FOR_NOZZLE_HEAT
#endif
@ -351,17 +351,17 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
DEBUG_ECHOPGM("Preheating ");
#if ENABLED(WAIT_FOR_NOZZLE_HEAT)
const uint16_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0;
const int16_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0;
if (hotendPreheat) {
DEBUG_ECHOPAIR("hotend (", hotendPreheat, ")");
thermalManager.setTargetHotend(hotendPreheat, 0);
}
#elif ENABLED(WAIT_FOR_BED_HEAT)
constexpr uint16_t hotendPreheat = 0;
constexpr int16_t hotendPreheat = 0;
#endif
#if ENABLED(WAIT_FOR_BED_HEAT)
const uint16_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0;
const int16_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0;
if (bedPreheat) {
if (hotendPreheat) DEBUG_ECHOPGM(" and ");
DEBUG_ECHOPAIR("bed (", bedPreheat, ")");

View File

@ -61,7 +61,7 @@ public:
static xyz_pos_t offset;
#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
static void preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp);
static void preheat_for_probing(const int16_t hotend_temp, const int16_t bed_temp);
#endif
static bool set_deployed(const bool deploy);