Browse Source

Save LCD_CLICKED before it is cleared

The SD card menu was refreshing so slowly that the button interrupt was clearing LCD_CLICKED before the menu items could check it.
Brendan-csel 12 years ago
parent
commit
be2dea1dc6
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      Marlin/ultralcd.cpp

+ 2
- 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;\

Loading…
Cancel
Save