Browse Source

Merge pull request #561 from Brendan-csel/Marlin_v1

Fix for Viki LCD issues printing from SD card
ErikZalm 12 years ago
parent
commit
bdc2621119
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      Marlin/ultralcd.cpp

+ 4
- 1
Marlin/ultralcd.cpp View File

@@ -96,6 +96,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
96 96
     if (encoderPosition > 0x8000) encoderPosition = 0; \
97 97
     if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM < currentMenuViewOffset) currentMenuViewOffset = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\
98 98
     uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
99
+    bool wasClicked = LCD_CLICKED;\
99 100
     for(uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
100 101
         _menuItemNr = 0;
101 102
 #define MENU_ITEM(type, label, args...) do { \
@@ -108,7 +109,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
108 109
                 lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
109 110
             }\
110 111
         }\
111
-        if (LCD_CLICKED && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\
112
+        if (wasClicked && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\
112 113
             lcd_quick_feedback(); \
113 114
             menu_action_ ## type ( args ); \
114 115
             return;\
@@ -694,6 +695,8 @@ static void lcd_sd_updir()
694 695
 
695 696
 void lcd_sdcard_menu()
696 697
 {
698
+    if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) 
699
+        return;	// nothing to do (so don't thrash the SD card)
697 700
     uint16_t fileCnt = card.getnrfilenames();
698 701
     START_MENU();
699 702
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);

Loading…
Cancel
Save