Add power panic recovery to active state

Fix M79 send only recovery action when power panic recovery is pending

Fix rebase issues
This commit is contained in:
3d-gussner 2024-01-09 16:24:32 +01:00
parent d1b88e1684
commit ffeda98894
2 changed files with 14 additions and 5 deletions

View File

@ -522,7 +522,8 @@ bool __attribute__((noinline)) printer_active() {
|| (lcd_commands_type != LcdCommands::Idle)
|| MMU2::mmu2.MMU_PRINT_SAVED()
|| homing_flag
|| mesh_bed_leveling_flag;
|| mesh_bed_leveling_flag
|| (eeprom_read_byte((uint8_t*)EEPROM_UVLO) != PowerPanic::NO_PENDING_RECOVERY);
}
// Currently only used in one place, allowed to be inlined
@ -4126,8 +4127,8 @@ void process_commands()
// M24 - Start SD print
enquecommand_P(MSG_M24);
// Print is recovered, clear the recovery flag
eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY);
// Print is recovered, clear the recovery flag
eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY);
}
else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_USB)
{
@ -5998,7 +5999,9 @@ Sigma_Exit:
}
}
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_USB && printingIsPaused()) {
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_USB
&& eeprom_read_byte((uint8_t*)EEPROM_UVLO) != PowerPanic::NO_PENDING_RECOVERY
&& printingIsPaused()) {
// The print is in a paused state. The print was recovered following a power panic
// but up to this point the printer has been waiting for the M79 from the host
// Send action to the host, so the host can resume the print. It is up to the host

View File

@ -45,6 +45,8 @@
#include "Prusa_farm.h"
#include "power_panic.h"
static void lcd_sd_updir();
static void lcd_mesh_bed_leveling_settings();
#ifdef LCD_BL_PIN
@ -5281,7 +5283,11 @@ static void lcd_main_menu()
}
}
}
if((printJobOngoing() || printingIsPaused()) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) {
if((printJobOngoing()
|| printingIsPaused()
|| (eeprom_read_byte((uint8_t*)EEPROM_UVLO) != PowerPanic::NO_PENDING_RECOVERY))
&& (custom_message_type != CustomMsg::MeshBedLeveling)
&& !processing_tcode) {
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
}
#ifdef THERMAL_MODEL