Browse Source

Remove 5s timer hack. Encoder pos is saved on print start!

pull/1/head
Scott Lahteine 7 years ago
parent
commit
12458cefc4
  1. 23
      Marlin/src/lcd/ultralcd.cpp

23
Marlin/src/lcd/ultralcd.cpp

@ -3775,16 +3775,6 @@ void kill_screen(const char* lcd_msg) {
void lcd_sdcard_menu() { void lcd_sdcard_menu() {
ENCODER_DIRECTION_MENUS(); ENCODER_DIRECTION_MENUS();
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
static millis_t assume_print_finished = 0;
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 = last_sdfile_encoderPosition; // encoderPosition to the last selected item.
assume_print_finished = millis() + 5000;
}
last_sdfile_encoderPosition = encoderPosition; // needed as a workaround for the 5s timer
#endif
const uint16_t fileCnt = card.getnrfilenames(); const uint16_t fileCnt = card.getnrfilenames();
START_MENU(); START_MENU();
MENU_BACK(MSG_MAIN); MENU_BACK(MSG_MAIN);
@ -4744,18 +4734,13 @@ void lcd_update() {
// then we want to use 1/2 of the time only. // then we want to use 1/2 of the time only.
uint16_t bbr2 = planner.block_buffer_runtime() >> 1; uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
if (
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
(lcdDrawUpdate || drawing_screen) && ( #define IS_DRAWING drawing_screen
!bbr2 || (bbr2 > max_display_update_time)
#if ENABLED(SDSUPPORT)
|| currentScreen == lcd_sdcard_menu
#endif
)
#else #else
lcdDrawUpdate && (!bbr2 || (bbr2 > max_display_update_time)) #define IS_DRAWING false
#endif #endif
) {
if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) {
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
if (!drawing_screen) if (!drawing_screen)
#endif #endif

Loading…
Cancel
Save