From 73436e93510d3fd368aea1c14fbff34277e0c655 Mon Sep 17 00:00:00 2001 From: Juan Francisco Estrada Date: Tue, 7 Nov 2023 22:56:13 +0100 Subject: [PATCH] Fixed Reprint from USB and from SD, some debug is needed --- Firmware/cmdqueue.cpp | 1 - Firmware/ultralcd.cpp | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index 96cb302ab..73e2b830c 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -63,7 +63,6 @@ bool cmdqueue_pop_front() // No serial communication is pending. Reset both pointers to zero. bufindw = 0; bufindr = bufindw; - enableReprint = true; } else { // There is at least one ready line in the buffer. // First skip the current command ID and iterate up to the end of the string. diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index c727551f8..c2c7f0dd7 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -45,7 +45,6 @@ #include "Prusa_farm.h" -#include "power_panic.h" static void lcd_sd_updir(); static void lcd_mesh_bed_leveling_settings(); @@ -259,6 +258,8 @@ bool bSettings; // flag (i.e. 'fake parameter' //action: Reprint bool enableReprint = false; +bool enableReprintUSB = false; + static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 1; @@ -5198,13 +5199,13 @@ static void lcd_main_menu() #endif //TMC2130_DEBUG // Menu item for reprint - if(!printer_active() && enableReprint && card.cardOK) + if(!printer_active() && enableReprint && card.cardOK && !enableReprintUSB) { MENU_ITEM_SUBMENU_P(_T(MSG_REPRINT), reprint_from_eeprom); - }else if(!printer_active() && enableReprint && saved_printing_type == PowerPanic::PRINT_TYPE_USB) + }else if(!printer_active() && enableReprintUSB ) { - lcd_reprint_usb_print(); - }else if (!card.cardOK && (saved_printing_type != PowerPanic::PRINT_TYPE_USB)) + MENU_ITEM_SUBMENU_P(_T(MSG_REPRINT), lcd_reprint_usb_print); + }else if (!card.cardOK) { enableReprint = false; } @@ -7516,4 +7517,7 @@ void reprint_from_eeprom() { void lcd_reprint_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_REPRINT); + enableReprint=false; + enableReprintUSB=false; + lcd_return_to_status(); }