From fda30f82c8c187c2af8ce46c73b4f7101b9b7bbb Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 21 Dec 2023 14:59:57 +0100 Subject: [PATCH 1/6] Don't show `Set Ready`when not idle --- Firmware/ultralcd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index c45c75639..abfc3a97b 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5251,12 +5251,12 @@ static void lcd_main_menu() MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT c=18 - } - if (GetPrinterState() < PrinterState::IsSDPrinting && M79_timer_get_status()) { - if(GetPrinterState() == PrinterState::IsReady) { - MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); - } else { - MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); + if (M79_timer_get_status()) { + if(GetPrinterState() == PrinterState::IsReady) { + MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); + } else { + MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); + } } } if (mesh_bed_leveling_flag == false && homing_flag == false && !printingIsPaused() && !processing_tcode) { From c9aba688e3f3d95015d5d1a526c382b703353ddc Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 27 Dec 2023 16:37:34 +0100 Subject: [PATCH 2/6] Saving few bytes by removing spaces in `//action:` host commands. Thanks to @sarusani pointing out inconsistent documentation. Renaming `MSG_OCTOPRINT_*` to `MSG_HOST_ACTION_*` as it is used also with PrusaLink and other host printing solutions Fix rebase issues --- Firmware/Marlin_main.cpp | 4 ++-- Firmware/messages.cpp | 18 +++++++++--------- Firmware/messages.h | 18 +++++++++--------- Firmware/ultralcd.cpp | 16 ++++++++-------- Firmware/xyzcal.cpp | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f5e2fd5a6..143942707 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -979,7 +979,7 @@ static void fw_crash_init() if(xfdump_check_state(&crash_reason)) { // always signal to the host that a dump is available for retrieval - puts_P(_N("// action:dump_available")); + puts_P(_N("//action:dump_available")); #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && @@ -6003,7 +6003,7 @@ Sigma_Exit: // 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 // to resume the print correctly. - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_UVLO_RECOVERY_READY); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); } break; diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 3f5056018..12b314392 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -228,15 +228,15 @@ const char MSG_ENDSTOP_OPEN[] PROGMEM_N1 = "open"; //// const char MSG_POWERUP[] PROGMEM_N1 = "PowerUp"; //// const char MSG_ERR_STOPPED[] PROGMEM_N1 = "Printer stopped due to errors. Supervision required."; //// const char MSG_ENDSTOP_HIT[] PROGMEM_N1 = "TRIGGERED"; //// -const char MSG_OCTOPRINT_ASK_PAUSE[] PROGMEM_N1 = "// action:pause"; //// -const char MSG_OCTOPRINT_PAUSED[] PROGMEM_N1 = "// action:paused"; //// -const char MSG_OCTOPRINT_ASK_RESUME[] PROGMEM_N1 = "// action:resume"; //// -const char MSG_OCTOPRINT_RESUMED[] PROGMEM_N1 = "// action:resumed"; //// -const char MSG_OCTOPRINT_CANCEL[] PROGMEM_N1 = "// action:cancel"; //// -const char MSG_OCTOPRINT_READY[] PROGMEM_N1 = "// action:ready"; //// -const char MSG_OCTOPRINT_NOT_READY[] PROGMEM_N1 = "// action:not_ready"; //// -const char MSG_OCTOPRINT_START[] PROGMEM_N1 = "// action:start"; //// -const char MSG_OCTOPRINT_UVLO_RECOVERY_READY[] PROGMEM_N1 = "// action:uvlo_recovery_ready"; //// +const char MSG_HOST_ACTION_ASK_PAUSE[] PROGMEM_N1 = "//action:pause"; //// +const char MSG_HOST_ACTION_PAUSED[] PROGMEM_N1 = "//action:paused"; //// +const char MSG_HOST_ACTION_ASK_RESUME[] PROGMEM_N1 = "//action:resume"; //// +const char MSG_HOST_ACTION_RESUMED[] PROGMEM_N1 = "//action:resumed"; //// +const char MSG_HOST_ACTION_CANCEL[] PROGMEM_N1 = "//action:cancel"; //// +const char MSG_HOST_ACTION_READY[] PROGMEM_N1 = "//action:ready"; //// +const char MSG_HOST_ACTION_NOT_READY[] PROGMEM_N1 = "//action:not_ready"; //// +const char MSG_HOST_ACTION_START[] PROGMEM_N1 = "//action:start"; //// +const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_recovery_ready"; //// #ifdef HOST_SHUTDOWN const char MSG_HOST_ACTION_SHUTDOWN[] PROGMEM_N1 = "//action:shutdown"; //// #endif //HOST_SHUTOWN diff --git a/Firmware/messages.h b/Firmware/messages.h index 76f4e507d..c9d7b74b1 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -232,15 +232,15 @@ extern const char MSG_ERR_STOPPED[]; extern const char MSG_ENDSTOP_HIT[]; extern const char MSG_EJECT_FROM_MMU[]; extern const char MSG_CUT_FILAMENT[]; -extern const char MSG_OCTOPRINT_ASK_PAUSE[]; -extern const char MSG_OCTOPRINT_PAUSED[]; -extern const char MSG_OCTOPRINT_ASK_RESUME[]; -extern const char MSG_OCTOPRINT_RESUMED[]; -extern const char MSG_OCTOPRINT_CANCEL[]; -extern const char MSG_OCTOPRINT_READY[]; -extern const char MSG_OCTOPRINT_NOT_READY[]; -extern const char MSG_OCTOPRINT_START[]; -extern const char MSG_OCTOPRINT_UVLO_RECOVERY_READY[]; +extern const char MSG_HOST_ACTION_ASK_PAUSE[]; +extern const char MSG_HOST_ACTION_PAUSED[]; +extern const char MSG_HOST_ACTION_ASK_RESUME[]; +extern const char MSG_HOST_ACTION_RESUMED[]; +extern const char MSG_HOST_ACTION_CANCEL[]; +extern const char MSG_HOST_ACTION_READY[]; +extern const char MSG_HOST_ACTION_NOT_READY[]; +extern const char MSG_HOST_ACTION_START[]; +extern const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[]; #ifdef HOST_SHUTDOWN extern const char MSG_HOST_ACTION_SHUTDOWN[]; #endif //HOST_SHUTOWN diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index abfc3a97b..ed12ccc2d 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1033,7 +1033,7 @@ void lcd_pause_print() { stop_and_save_print_to_ram(0.0, -default_retraction); - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_PAUSED); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); // Indicate that the printer is paused did_pause_print = true; @@ -1048,7 +1048,7 @@ void lcd_pause_print() //! @brief Send host action "pause" void lcd_pause_usb_print() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_ASK_PAUSE); + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); } static void lcd_move_menu_axis(); @@ -5033,7 +5033,7 @@ void lcd_resume_print() if (print_job_timer.isPaused()) print_job_timer.start(); refresh_cmd_timeout(); - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); custom_message_type = CustomMsg::Status; } @@ -5044,7 +5044,7 @@ void lcd_resume_usb_print() if (!resume_print_checks()) return; // resume the usb host - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_ASK_RESUME); + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); } static void change_sheet() @@ -5151,10 +5151,10 @@ static void lcd_sheet_menu() static void lcd_printer_ready_state_toggle() { if (GetPrinterState() == PrinterState::IsReady) { - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_NOT_READY); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); } else { - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_READY); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); } } @@ -5714,7 +5714,7 @@ void print_stop(bool interactive) card.sdprinting = false; card.closefile(); } else { - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); // for Octoprint + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); } #ifdef MESH_BED_LEVELING @@ -7510,6 +7510,6 @@ void lcd_reprint_from_eeprom() { //! @brief Send host action "start" void lcd_send_action_start() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_START); + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); lcd_return_to_status(); } diff --git a/Firmware/xyzcal.cpp b/Firmware/xyzcal.cpp index 96130d2c9..12c0f67b4 100644 --- a/Firmware/xyzcal.cpp +++ b/Firmware/xyzcal.cpp @@ -568,7 +568,7 @@ void __attribute__((noinline)) xyzcal_scan_pixels_32x32_Zhop(int16_t cx, int16_t xyzcal_lineXYZ_to((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, delay_us, 0); sm4_set_dir(X_AXIS, d); //@size=242 - DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep OctoPrint connection alive + DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive lcd_set_cursor(4,3); lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 From d1b88e168435390853c4deb3a23596363828601b Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 28 Dec 2023 12:53:26 +0100 Subject: [PATCH 3/6] Don't show `Print from SD` when host print is paused --- Firmware/ultralcd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ed12ccc2d..561d95177 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5292,6 +5292,7 @@ static void lcd_main_menu() // only allow starting SD print if hardware errors (temperature or fan) are cleared if(!get_temp_error() + && !printer_active() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED #endif //FANCHECK From ffeda988948f96d221ead91f2e9af312a7d6ae3b Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 9 Jan 2024 16:24:32 +0100 Subject: [PATCH 4/6] Add power panic recovery to active state Fix M79 send only recovery action when power panic recovery is pending Fix rebase issues --- Firmware/Marlin_main.cpp | 11 +++++++---- Firmware/ultralcd.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 143942707..e44eb55c5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -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 diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 561d95177..19fcf7f2f 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -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 From 52ba1b534db757d3159230418088f661ee15f658 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Jan 2024 08:51:22 +0100 Subject: [PATCH 5/6] Add HOST power panic auto recovery option Change `PRINT_TYPE_USB` to `PRINT_TYPE_HOST` Fix more rebase issues Fix rebase issue again --- Firmware/Marlin_main.cpp | 22 ++++++++++++++-------- Firmware/messages.cpp | 1 + Firmware/messages.h | 1 + Firmware/power_panic.cpp | 2 +- Firmware/power_panic.h | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index e44eb55c5..abcc341e8 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -321,6 +321,7 @@ uint8_t saved_bed_temperature; //!< Bed temperature bool saved_extruder_relative_mode; uint8_t saved_fan_speed = 0; //!< Print fan speed //! @} +bool uvlo_auto_recovery_ready = false; static int saved_feedmultiply_mm = 100; @@ -1585,7 +1586,8 @@ void setup() #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED)); #endif - if ( degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET) ){ + uvlo_auto_recovery_ready = (degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET)); + if (uvlo_auto_recovery_ready){ #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif @@ -1595,7 +1597,7 @@ void setup() #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Normal recovery!")); #endif - if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::PRINT_TYPE_USB) { + if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::PRINT_TYPE_HOST) { recover_print(0); } else { const uint8_t btn = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); @@ -1731,7 +1733,7 @@ void loop() KEEPALIVE_STATE(NOT_BUSY); } - if (printingIsPaused() && saved_printing_type == PowerPanic::PRINT_TYPE_USB) { //keep believing that usb is being printed. Prevents accessing dangerous menus while pausing. + if (printingIsPaused() && saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { //keep believing that usb is being printed. Prevents accessing dangerous menus while pausing. usb_timer.start(); } else if (usb_timer.expired(USB_TIMER_TIMEOUT)) { //just need to check if it expired. Nothing else is needed to be done. @@ -4130,7 +4132,7 @@ void process_commands() // 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) + else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST) { // For Host prints we need to start the timer so that the pause has any effect // this will allow g-codes to be processed while in the paused state @@ -5999,14 +6001,18 @@ Sigma_Exit: } } - if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_USB + if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST && 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 // to resume the print correctly. - SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); + if (uvlo_auto_recovery_ready) { + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); + } else { + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); + } } break; @@ -10658,7 +10664,7 @@ void save_print_file_state() { nlines = planner_calc_sd_length(); //number of lines of commands in planner saved_sdpos -= nlines; saved_sdpos -= buflen; //number of blocks in cmd buffer - saved_printing_type = PowerPanic::PRINT_TYPE_USB; + saved_printing_type = PowerPanic::PRINT_TYPE_HOST; } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; @@ -10759,7 +10765,7 @@ void restore_print_file_state() { card.setIndex(saved_sdpos); sdpos_atomic = saved_sdpos; card.sdprinting = true; - } else if (saved_printing_type == PowerPanic::PRINT_TYPE_USB) { //was usb printing + } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { //was usb printing gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing serial_count = 0; FlushSerialRequestResend(); diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 12b314392..c6b95762a 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -237,6 +237,7 @@ const char MSG_HOST_ACTION_READY[] PROGMEM_N1 = "//action:ready"; //// const char MSG_HOST_ACTION_NOT_READY[] PROGMEM_N1 = "//action:not_ready"; //// const char MSG_HOST_ACTION_START[] PROGMEM_N1 = "//action:start"; //// const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_recovery_ready"; //// +const char MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_auto_recovery_ready"; //// #ifdef HOST_SHUTDOWN const char MSG_HOST_ACTION_SHUTDOWN[] PROGMEM_N1 = "//action:shutdown"; //// #endif //HOST_SHUTOWN diff --git a/Firmware/messages.h b/Firmware/messages.h index c9d7b74b1..3c2732f04 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -241,6 +241,7 @@ extern const char MSG_HOST_ACTION_READY[]; extern const char MSG_HOST_ACTION_NOT_READY[]; extern const char MSG_HOST_ACTION_START[]; extern const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[]; +extern const char MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY[]; #ifdef HOST_SHUTDOWN extern const char MSG_HOST_ACTION_SHUTDOWN[]; #endif //HOST_SHUTOWN diff --git a/Firmware/power_panic.cpp b/Firmware/power_panic.cpp index 8b9e6de71..802f9c625 100644 --- a/Firmware/power_panic.cpp +++ b/Firmware/power_panic.cpp @@ -473,7 +473,7 @@ void restore_print_from_eeprom(bool mbl_was_active) { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); } - else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_USB) + else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); diff --git a/Firmware/power_panic.h b/Firmware/power_panic.h index 7dcb627dc..c34a831e3 100644 --- a/Firmware/power_panic.h +++ b/Firmware/power_panic.h @@ -10,7 +10,7 @@ enum PowerPanicFlag : uint8_t { // Types of printjobs possible when power panic is triggered enum PrintType : uint8_t { PRINT_TYPE_SD = 0, - PRINT_TYPE_USB = 1, + PRINT_TYPE_HOST = 1, PRINT_TYPE_NONE = 2, }; } // namespace PowerPanic From e7ef3d6db54571ace5f227b9f51b262081fe3889 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 23 Jan 2024 09:05:55 +0100 Subject: [PATCH 6/6] Fix nitpicking --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index abcc341e8..dff04d564 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -321,7 +321,7 @@ uint8_t saved_bed_temperature; //!< Bed temperature bool saved_extruder_relative_mode; uint8_t saved_fan_speed = 0; //!< Print fan speed //! @} -bool uvlo_auto_recovery_ready = false; +static bool uvlo_auto_recovery_ready = false; static int saved_feedmultiply_mm = 100;