Power panic recover lift by 20 Z_PAUSE_LIFT only once

by setting PENDING_RECOVERY_RETRY
Also the default saved_printing_type after a reboot is now PRINT_TYPE_NONE
This commit is contained in:
3d-gussner 2024-02-15 15:35:50 +01:00
parent 88b77ecce2
commit 47235bbf62
2 changed files with 4 additions and 3 deletions

View File

@ -312,7 +312,7 @@ static bool chdkActive = false;
//! @{
bool saved_printing = false; //!< Print is paused and saved in RAM
uint32_t saved_sdpos = 0; //!< SD card position, or line number in case of USB printing
uint8_t saved_printing_type = PowerPanic::PRINT_TYPE_SD;
uint8_t saved_printing_type = PowerPanic::PRINT_TYPE_NONE;
float saved_pos[NUM_AXIS] = { X_COORD_INVALID, 0, 0, 0 };
uint16_t saved_feedrate2 = 0; //!< Default feedrate (truncated from float)
static int saved_feedmultiply2 = 0;

View File

@ -315,11 +315,12 @@ void recover_print(uint8_t automatic) {
// Recover position, temperatures and extrude_multipliers
bool mbl_was_active = recover_machine_state_after_power_panic();
// Lift the print head 25mm, first to avoid collisions with oozed material with the print,
// Lift the print head 20mm, first to avoid collisions with oozed material with the print,
// and second also so one may remove the excess priming material.
if(eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::PENDING_RECOVERY)
{
enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + 25);
enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT);
eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY_RETRY);
}
// Home X and Y axes. Homing just X and Y shall not touch the babystep and the world2machine