From ce24d917e68f371f6da59891bb50e3039540c07f Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sat, 25 Nov 2023 15:35:44 +0000 Subject: [PATCH] power panic: Only send M24 for SD prints For host prints, we don't want to send M24. Change in memory: Flash: +16 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3baf122e0..430679b49 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4105,9 +4105,16 @@ void process_commands() else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); } - else if (code_seen_P(PSTR("uvlo"))) { // PRUSA uvlo - eeprom_update_byte((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); - enquecommand_P(MSG_M24); + else if (code_seen_P(PSTR("uvlo"))) // PRUSA uvlo + { + if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) + { + // 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); } else if (code_seen_P(PSTR("MMURES"))) // PRUSA MMURES {