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
     if (encoderPosition > 0x8000) encoderPosition = 0; \
96
     if (encoderPosition > 0x8000) encoderPosition = 0; \
97
     if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM < currentMenuViewOffset) currentMenuViewOffset = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\
97
     if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM < currentMenuViewOffset) currentMenuViewOffset = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\
98
     uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
98
     uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
99
+    bool wasClicked = LCD_CLICKED;\
99
     for(uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
100
     for(uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
100
         _menuItemNr = 0;
101
         _menuItemNr = 0;
101
 #define MENU_ITEM(type, label, args...) do { \
102
 #define MENU_ITEM(type, label, args...) do { \
108
                 lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
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
             lcd_quick_feedback(); \
113
             lcd_quick_feedback(); \
113
             menu_action_ ## type ( args ); \
114
             menu_action_ ## type ( args ); \
114
             return;\
115
             return;\

Loading…
Cancel
Save