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
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user