From 3f5f39576be4198ca68f770dea747f2dd639b3d9 Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Thu, 26 Oct 2017 15:50:18 -0500 Subject: [PATCH] Reprint option for last SD Memory card file (#8106) * Re-Print of same SD Memory Card file with single click * Re-Print of same SD Memory Card file with single click * This is the bugfix-v2.0.0 version of https://github.com/MarlinFirmware/Marlin/pull/8104 --- Marlin/Configuration_adv.h | 17 ++++++++-- Marlin/src/config/default/Configuration_adv.h | 17 ++++++++-- .../AlephObjects/TAZ4/Configuration_adv.h | 17 ++++++++-- .../examples/Anet/A6/Configuration_adv.h | 17 ++++++++-- .../examples/Anet/A8/Configuration_adv.h | 17 ++++++++-- .../examples/BQ/Hephestos/Configuration_adv.h | 17 ++++++++-- .../BQ/Hephestos_2/Configuration_adv.h | 17 ++++++++-- .../examples/BQ/WITBOX/Configuration_adv.h | 17 ++++++++-- .../examples/Cartesio/Configuration_adv.h | 17 ++++++++-- .../Creality/CR-10/Configuration_adv.h | 17 ++++++++-- .../config/examples/Felix/Configuration_adv.h | 17 ++++++++-- .../i3-2020/Configuration.h | 0 .../i3-2020/Configuration_adv.h | 17 ++++++++-- .../Infitary/i3-M508/Configuration_adv.h | 17 ++++++++-- .../examples/Malyan/M150/Configuration_adv.h | 20 +++++++---- .../Micromake/C1/enhanced/Configuration_adv.h | 17 ++++++++-- .../examples/Mks/Sbase/Configuration_adv.h | 17 ++++++++-- .../examples/RigidBot/Configuration_adv.h | 17 ++++++++-- .../config/examples/SCARA/Configuration_adv.h | 17 ++++++++-- .../examples/Sanguinololu/Configuration_adv.h | 17 ++++++++-- .../examples/TinyBoy2/Configuration_adv.h | 17 ++++++++-- .../Velleman/K8200/Configuration_adv.h | 17 ++++++++-- .../Velleman/K8400/Configuration_adv.h | 17 ++++++++-- .../FLSUN/auto_calibrate/Configuration_adv.h | 17 ++++++++-- .../FLSUN/kossel_mini/Configuration_adv.h | 17 ++++++++-- .../delta/generic/Configuration_adv.h | 17 ++++++++-- .../delta/kossel_mini/Configuration_adv.h | 17 ++++++++-- .../delta/kossel_pro/Configuration_adv.h | 17 ++++++++-- .../delta/kossel_xl/Configuration_adv.h | 17 ++++++++-- .../gCreate/gMax1.5+/Configuration_adv.h | 17 ++++++++-- .../examples/makibox/Configuration_adv.h | 17 ++++++++-- .../tvrrug/Round2/Configuration_adv.h | 17 ++++++++-- .../config/examples/wt150/Configuration_adv.h | 17 ++++++++-- Marlin/src/feature/Max7219_Debug_LEDs.cpp | 11 +++---- Marlin/src/lcd/ultralcd.cpp | 33 +++++++++++++++++-- Marlin/src/sd/cardreader.cpp | 21 ++++++++++++ 36 files changed, 503 insertions(+), 109 deletions(-) rename Marlin/src/config/examples/{Folger Tech => FolgerTech}/i3-2020/Configuration.h (100%) rename Marlin/src/config/examples/{Folger Tech => FolgerTech}/i3-2020/Configuration_adv.h (98%) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 14c0fd8208..9e2dddb3ae 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index 14c0fd8208..9e2dddb3ae 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index d190904f12..be77222971 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 209311e2c1..164a6e7e4f 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 70675f3558..09d83ea7b8 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index f045bdd4cb..cf2fa49203 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index ce8b341bec..c49334d13a 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -559,11 +559,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index f045bdd4cb..cf2fa49203 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index 31ad3fac39..360065def9 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index dda5ec9866..4ce6c5f88f 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 30c41ebd07..94a5da9394 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h similarity index 100% rename from Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h rename to Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h similarity index 98% rename from Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h rename to Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 8c84c683fc..8ed11fc895 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index 6c7f2c3d20..aab33e753c 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 764b58e361..6a4f21d04d 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -556,14 +556,22 @@ // This allows hosts to request long names for files and folders with M33 #define LONG_FILENAME_HOST_SUPPORT - // Enable this option to scroll long filenames in the SD card menu - //#define SCROLL_LONG_FILENAMES - - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index e4f77d3070..632dfa9150 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -563,11 +563,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index fae5ea1ccf..744543d1fe 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index 5ad95c98cc..9ab2502283 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index de89cc7e57..feba2005ed 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index 2ecd9ef447..8b7d1e2048 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -551,11 +551,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index f75e352137..ef4c53e7e3 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index d63595d1a3..1bce3c83fe 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -570,11 +570,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 6428a21194..7c6f9b05eb 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 6a6379658a..8d20014824 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -564,11 +564,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 04ae683d0d..10c4067064 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -564,11 +564,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index 04ae683d0d..10c4067064 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -564,11 +564,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index 04ae683d0d..10c4067064 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -564,11 +564,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h index 75a918e647..1b77319fd8 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -569,11 +569,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index aa05d414fc..05483bee87 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -564,11 +564,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 54ae9d1c92..8098402604 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index 68782035ae..e55faa8ce8 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 2bb64edf34..2cd2e0fbb5 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index 3d840dbb79..616254d333 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -562,11 +562,22 @@ // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES - // This option allows you to abort SD printing when any endstop is triggered. - // This feature must be enabled with "M540 S1" or from the LCD menu. - // To have any effect, endstops must be enabled during SD printing. + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + /** + * This option allows you to easily reprint the same SD Card file as + * was last printed. At the end of a print, the LCD Menu will jump + * straight to the file previously selected. A single click of the encoder + * wheel will restart the print. Another file or LCD option can be + * selected by using the encoder wheel to navigate through the menu structure. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + #endif // SDSUPPORT /** diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.cpp b/Marlin/src/feature/Max7219_Debug_LEDs.cpp index fe42a18611..ece730e1d2 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.cpp +++ b/Marlin/src/feature/Max7219_Debug_LEDs.cpp @@ -328,14 +328,11 @@ void Max7219_idle_tasks() { #endif #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - static int debug_cnt = 0; - #ifdef CPU_32_BIT - if (debug_cnt++ > 1000) { - #else - if (debug_cnt++ > 100) { - #endif + static millis_t next_blink = 0; + + if (ELAPSED(millis(), next_blink)) { Max7219_LED_Toggle(7, 7); - debug_cnt = 0; + next_blink = millis() + 750; } #endif diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 37c6a61eca..ca036563a0 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -3742,10 +3742,25 @@ void kill_screen(const char* lcd_msg) { * "Print from SD" submenu * */ + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + uint32_t saved_encoderPosition = 0; + static millis_t assume_print_finished = 0; + #endif + void lcd_sdcard_menu() { ENCODER_DIRECTION_MENUS(); - if (!lcdDrawUpdate && !lcd_clicked) return; // nothing to do (so don't thrash the SD card) - const uint16_t fileCnt = card.get_num_Files(); + + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + if (ELAPSED(millis(), assume_print_finished)) { // if the printer has been busy printing, lcd_sdcard_menu() should not + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; // have been active for 5 seconds. In this case, restore the previous + encoderPosition = saved_encoderPosition; // encoderPosition to the last selected item. + assume_print_finished = millis() + 5000; + } + saved_encoderPosition = encoderPosition; + defer_return_to_status = true; + #endif + + const uint16_t fileCnt = card.getnrfilenames(); START_MENU(); MENU_BACK(MSG_MAIN); card.getWorkDirName(); @@ -4395,6 +4410,9 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(SDSUPPORT) void menu_action_sdfile(const char* filename, char* longFilename) { + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + saved_encoderPosition = encoderPosition; // Save which file was selected for later use + #endif UNUSED(longFilename); card.openAndPrintFile(filename); lcd_return_to_status(); @@ -4702,7 +4720,11 @@ void lcd_update() { uint16_t bbr2 = planner.block_buffer_runtime() >> 1; #if ENABLED(DOGLCD) - if ((lcdDrawUpdate || drawing_screen) && (!bbr2 || (bbr2 > max_display_update_time))) + if ((lcdDrawUpdate || drawing_screen) && (!bbr2 || (bbr2 > max_display_update_time) + #if ENABLED(SDSUPPORT) + || (currentScreen == lcd_sdcard_menu) + #endif + )) #else if (lcdDrawUpdate && (!bbr2 || (bbr2 > max_display_update_time))) #endif @@ -4756,7 +4778,12 @@ void lcd_update() { // Return to Status Screen after a timeout if (currentScreen == lcd_status_screen || defer_return_to_status) + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + if (currentScreen != lcd_sdcard_menu) // lcd_sdcard_menu() does not time out if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; // When the printer finishes a file, it will wait with the file selected for + #else // a re-print. return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; + #endif else if (ELAPSED(ms, return_to_status_ms)) lcd_return_to_status(); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index cfa7b513f5..3afb050b25 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -892,6 +892,15 @@ uint16_t CardReader::get_num_Files() { ; } +#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + typedef void (*screenFunc_t)(); + extern void lcd_sdcard_menu(); + extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0); + extern uint32_t saved_encoderPosition; + extern bool screen_changed, drawing_screen, defer_return_to_status; + void _lcd_synchronize(); // Not declared in any LCD header file. Probably, that should be changed. +#endif + void CardReader::printingHasFinished() { stepper.synchronize(); file.close(); @@ -911,6 +920,18 @@ void CardReader::printingHasFinished() { #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif + + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + _lcd_synchronize(); + safe_delay(50); + _lcd_synchronize(); + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + drawing_screen = screen_changed = true; + lcd_goto_screen(lcd_sdcard_menu, saved_encoderPosition); + defer_return_to_status = true; + lcd_update(); + #endif } }