瀏覽代碼

Fix ADC_KEYPAD middle button (#12493)

Scott Lahteine 6 年之前
父節點
當前提交
c5642a894f
沒有連結到貢獻者的電子郵件帳戶。
共有 3 個檔案被更改,包括 80 行新增79 行删除
  1. 3
    0
      Marlin/src/inc/Conditionals_LCD.h
  2. 37
    37
      Marlin/src/lcd/ultralcd.cpp
  3. 40
    42
      Marlin/src/lcd/ultralcd.h

+ 3
- 0
Marlin/src/inc/Conditionals_LCD.h 查看文件

309
 #define HAS_SHIFT_ENCODER   (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL))))
309
 #define HAS_SHIFT_ENCODER   (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL))))
310
 #define HAS_ENCODER_WHEEL   (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL))
310
 #define HAS_ENCODER_WHEEL   (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL))
311
 
311
 
312
+// I2C buttons must be read in the main thread
313
+#define HAS_SLOW_BUTTONS (ENABLED(LCD_I2C_VIKI) || ENABLED(LCD_I2C_PANELOLU2))
314
+
312
 #if HAS_GRAPHICAL_LCD
315
 #if HAS_GRAPHICAL_LCD
313
   /**
316
   /**
314
    * Default LCD contrast for Graphical LCD displays
317
    * Default LCD contrast for Graphical LCD displays

+ 37
- 37
Marlin/src/lcd/ultralcd.cpp 查看文件

79
  #include "../feature/bedlevel/bedlevel.h"
79
  #include "../feature/bedlevel/bedlevel.h"
80
 #endif
80
 #endif
81
 
81
 
82
-#if DISABLED(LCD_USE_I2C_BUZZER)
82
+#if HAS_BUZZER
83
   #include "../libs/buzzer.h"
83
   #include "../libs/buzzer.h"
84
 #endif
84
 #endif
85
 
85
 
86
 #if HAS_ENCODER_ACTION
86
 #if HAS_ENCODER_ACTION
87
   volatile uint8_t MarlinUI::buttons;
87
   volatile uint8_t MarlinUI::buttons;
88
-  #if ENABLED(LCD_HAS_SLOW_BUTTONS)
88
+  #if HAS_SLOW_BUTTONS
89
     volatile uint8_t MarlinUI::slow_buttons;
89
     volatile uint8_t MarlinUI::slow_buttons;
90
   #endif
90
   #endif
91
 #endif
91
 #endif
248
     lcd_sd_status = 2; // UNKNOWN
248
     lcd_sd_status = 2; // UNKNOWN
249
   #endif
249
   #endif
250
 
250
 
251
-  #if HAS_ENCODER_ACTION && ENABLED(LCD_HAS_SLOW_BUTTONS)
251
+  #if HAS_ENCODER_ACTION && HAS_SLOW_BUTTONS
252
     slow_buttons = 0;
252
     slow_buttons = 0;
253
   #endif
253
   #endif
254
 
254
 
307
           refresh(LCDVIEW_REDRAW_NOW);
307
           refresh(LCDVIEW_REDRAW_NOW);
308
           if (encoderDirection == -1) { // side effect which signals we are inside a menu
308
           if (encoderDirection == -1) { // side effect which signals we are inside a menu
309
             #if HAS_LCD_MENU
309
             #if HAS_LCD_MENU
310
-              if      (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))   encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
311
-              else if (RRK(EN_REPRAPWORLD_KEYPAD_UP))     encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
312
-              else if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT))   { MenuItem_back::action(); quick_feedback(); }
313
-              else if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT))  { return_to_status(); quick_feedback(); }
310
+              if      (RRK(EN_KEYPAD_DOWN))   encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
311
+              else if (RRK(EN_KEYPAD_UP))     encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
312
+              else if (RRK(EN_KEYPAD_LEFT))   { MenuItem_back::action(); quick_feedback(); }
313
+              else if (RRK(EN_KEYPAD_RIGHT))  { return_to_status(); quick_feedback(); }
314
             #endif
314
             #endif
315
           }
315
           }
316
-          else if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))     encoderPosition -= ENCODER_PULSES_PER_STEP;
317
-          else if (RRK(EN_REPRAPWORLD_KEYPAD_UP))       encoderPosition += ENCODER_PULSES_PER_STEP;
318
-          else if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT))     { MenuItem_back::action(); quick_feedback(); }
319
-          else if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT))    encoderPosition = 0;
316
+          else if (RRK(EN_KEYPAD_DOWN))     encoderPosition -= ENCODER_PULSES_PER_STEP;
317
+          else if (RRK(EN_KEYPAD_UP))       encoderPosition += ENCODER_PULSES_PER_STEP;
318
+          else if (RRK(EN_KEYPAD_LEFT))     { MenuItem_back::action(); quick_feedback(); }
319
+          else if (RRK(EN_KEYPAD_RIGHT))    encoderPosition = 0;
320
         #endif
320
         #endif
321
         next_button_update_ms = millis() + ADC_MIN_KEY_DELAY;
321
         next_button_update_ms = millis() + ADC_MIN_KEY_DELAY;
322
         return true;
322
         return true;
326
 
326
 
327
       static uint8_t keypad_debounce = 0;
327
       static uint8_t keypad_debounce = 0;
328
 
328
 
329
-      if (!RRK( EN_REPRAPWORLD_KEYPAD_F1    | EN_REPRAPWORLD_KEYPAD_F2
330
-              | EN_REPRAPWORLD_KEYPAD_F3    | EN_REPRAPWORLD_KEYPAD_DOWN
331
-              | EN_REPRAPWORLD_KEYPAD_RIGHT | EN_REPRAPWORLD_KEYPAD_MIDDLE
332
-              | EN_REPRAPWORLD_KEYPAD_UP    | EN_REPRAPWORLD_KEYPAD_LEFT )
329
+      if (!RRK( EN_KEYPAD_F1    | EN_KEYPAD_F2
330
+              | EN_KEYPAD_F3    | EN_KEYPAD_DOWN
331
+              | EN_KEYPAD_RIGHT | EN_KEYPAD_MIDDLE
332
+              | EN_KEYPAD_UP    | EN_KEYPAD_LEFT )
333
       ) {
333
       ) {
334
         if (keypad_debounce > 0) keypad_debounce--;
334
         if (keypad_debounce > 0) keypad_debounce--;
335
       }
335
       }
340
 
340
 
341
         #if HAS_LCD_MENU
341
         #if HAS_LCD_MENU
342
 
342
 
343
-          if (RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE))  goto_screen(menu_move);
343
+          if (RRK(EN_KEYPAD_MIDDLE))  goto_screen(menu_move);
344
 
344
 
345
           #if DISABLED(DELTA) && Z_HOME_DIR == -1
345
           #if DISABLED(DELTA) && Z_HOME_DIR == -1
346
-            if (RRK(EN_REPRAPWORLD_KEYPAD_F2))    _reprapworld_keypad_move(Z_AXIS,  1);
346
+            if (RRK(EN_KEYPAD_F2))    _reprapworld_keypad_move(Z_AXIS,  1);
347
           #endif
347
           #endif
348
 
348
 
349
           if (homed) {
349
           if (homed) {
350
             #if ENABLED(DELTA) || Z_HOME_DIR != -1
350
             #if ENABLED(DELTA) || Z_HOME_DIR != -1
351
-              if (RRK(EN_REPRAPWORLD_KEYPAD_F2))  _reprapworld_keypad_move(Z_AXIS,  1);
351
+              if (RRK(EN_KEYPAD_F2))  _reprapworld_keypad_move(Z_AXIS,  1);
352
             #endif
352
             #endif
353
-            if (RRK(EN_REPRAPWORLD_KEYPAD_F3))    _reprapworld_keypad_move(Z_AXIS, -1);
354
-            if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT))  _reprapworld_keypad_move(X_AXIS, -1);
355
-            if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT)) _reprapworld_keypad_move(X_AXIS,  1);
356
-            if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))  _reprapworld_keypad_move(Y_AXIS,  1);
357
-            if (RRK(EN_REPRAPWORLD_KEYPAD_UP))    _reprapworld_keypad_move(Y_AXIS, -1);
353
+            if (RRK(EN_KEYPAD_F3))    _reprapworld_keypad_move(Z_AXIS, -1);
354
+            if (RRK(EN_KEYPAD_LEFT))  _reprapworld_keypad_move(X_AXIS, -1);
355
+            if (RRK(EN_KEYPAD_RIGHT)) _reprapworld_keypad_move(X_AXIS,  1);
356
+            if (RRK(EN_KEYPAD_DOWN))  _reprapworld_keypad_move(Y_AXIS,  1);
357
+            if (RRK(EN_KEYPAD_UP))    _reprapworld_keypad_move(Y_AXIS, -1);
358
           }
358
           }
359
 
359
 
360
         #endif // HAS_LCD_MENU
360
         #endif // HAS_LCD_MENU
361
 
361
 
362
-        if (!homed && RRK(EN_REPRAPWORLD_KEYPAD_F1)) enqueue_and_echo_commands_P(PSTR("G28"));
362
+        if (!homed && RRK(EN_KEYPAD_F1)) enqueue_and_echo_commands_P(PSTR("G28"));
363
         return true;
363
         return true;
364
       }
364
       }
365
 
365
 
666
     }
666
     }
667
     else wait_for_unclick = false;
667
     else wait_for_unclick = false;
668
 
668
 
669
-    #if BUTTON_EXISTS(BACK)
669
+    #if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK)
670
       if (LCD_BACK_CLICKED()) {
670
       if (LCD_BACK_CLICKED()) {
671
         quick_feedback();
671
         quick_feedback();
672
         goto_previous_screen();
672
         goto_previous_screen();
717
 
717
 
718
     #if HAS_ENCODER_ACTION
718
     #if HAS_ENCODER_ACTION
719
 
719
 
720
-      #if ENABLED(LCD_HAS_SLOW_BUTTONS)
720
+      #if HAS_SLOW_BUTTONS
721
         slow_buttons = read_slow_buttons(); // Buttons that take too long to read in interrupt context
721
         slow_buttons = read_slow_buttons(); // Buttons that take too long to read in interrupt context
722
       #endif
722
       #endif
723
 
723
 
905
 
905
 
906
   static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = {
906
   static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = {
907
     // VALUE_MIN, VALUE_MAX, KEY
907
     // VALUE_MIN, VALUE_MAX, KEY
908
-    { 4000, 4096, 1 + BLEN_REPRAPWORLD_KEYPAD_F1     }, // F1
909
-    { 4000, 4096, 1 + BLEN_REPRAPWORLD_KEYPAD_F2     }, // F2
910
-    { 4000, 4096, 1 + BLEN_REPRAPWORLD_KEYPAD_F3     }, // F3
911
-    {  300,  500, 1 + BLEN_REPRAPWORLD_KEYPAD_LEFT   }, // LEFT
912
-    { 1900, 2200, 1 + BLEN_REPRAPWORLD_KEYPAD_RIGHT  }, // RIGHT
913
-    {  570,  870, 1 + BLEN_REPRAPWORLD_KEYPAD_UP     }, // UP
914
-    { 2670, 2870, 1 + BLEN_REPRAPWORLD_KEYPAD_DOWN   }, // DOWN
915
-    { 1150, 1450, 1 + BLEN_REPRAPWORLD_KEYPAD_MIDDLE }, // ENTER
908
+    { 4000, 4096, 1 + BLEN_KEYPAD_F1     }, // F1
909
+    { 4000, 4096, 1 + BLEN_KEYPAD_F2     }, // F2
910
+    { 4000, 4096, 1 + BLEN_KEYPAD_F3     }, // F3
911
+    {  300,  500, 1 + BLEN_KEYPAD_LEFT   }, // LEFT
912
+    { 1900, 2200, 1 + BLEN_KEYPAD_RIGHT  }, // RIGHT
913
+    {  570,  870, 1 + BLEN_KEYPAD_UP     }, // UP
914
+    { 2670, 2870, 1 + BLEN_KEYPAD_DOWN   }, // DOWN
915
+    { 1150, 1450, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER
916
   };
916
   };
917
 
917
 
918
   uint8_t get_ADC_keyValue(void) {
918
   uint8_t get_ADC_keyValue(void) {
1025
         #endif // UP || DWN || LFT || RT
1025
         #endif // UP || DWN || LFT || RT
1026
 
1026
 
1027
         buttons = newbutton
1027
         buttons = newbutton
1028
-          #if ENABLED(LCD_HAS_SLOW_BUTTONS)
1028
+          #if HAS_SLOW_BUTTONS
1029
             | slow_buttons
1029
             | slow_buttons
1030
           #endif
1030
           #endif
1031
         ;
1031
         ;
1087
     #endif // HAS_ENCODER_WHEEL
1087
     #endif // HAS_ENCODER_WHEEL
1088
   }
1088
   }
1089
 
1089
 
1090
-  #if ENABLED(LCD_HAS_SLOW_BUTTONS)
1090
+  #if HAS_SLOW_BUTTONS
1091
 
1091
 
1092
     uint8_t MarlinUI::read_slow_buttons() {
1092
     uint8_t MarlinUI::read_slow_buttons() {
1093
       #if ENABLED(LCD_I2C_TYPE_MCP23017)
1093
       #if ENABLED(LCD_I2C_TYPE_MCP23017)
1102
       #endif // LCD_I2C_TYPE_MCP23017
1102
       #endif // LCD_I2C_TYPE_MCP23017
1103
     }
1103
     }
1104
 
1104
 
1105
-  #endif // LCD_HAS_SLOW_BUTTONS
1105
+  #endif
1106
 
1106
 
1107
 #endif // HAS_ENCODER_ACTION
1107
 #endif // HAS_ENCODER_ACTION
1108
 
1108
 

+ 40
- 42
Marlin/src/lcd/ultralcd.h 查看文件

88
 
88
 
89
 #endif
89
 #endif
90
 
90
 
91
+// REPRAPWORLD_KEYPAD (and ADC_KEYPAD)
91
 #if ENABLED(REPRAPWORLD_KEYPAD)
92
 #if ENABLED(REPRAPWORLD_KEYPAD)
92
-  #define REPRAPWORLD_BTN_OFFSET          0 // Bit offset into buttons for shift register values
93
-
94
-  #define BLEN_REPRAPWORLD_KEYPAD_F3      0
95
-  #define BLEN_REPRAPWORLD_KEYPAD_F2      1
96
-  #define BLEN_REPRAPWORLD_KEYPAD_F1      2
97
-  #define BLEN_REPRAPWORLD_KEYPAD_DOWN    3
98
-  #define BLEN_REPRAPWORLD_KEYPAD_RIGHT   4
99
-  #define BLEN_REPRAPWORLD_KEYPAD_MIDDLE  5
100
-  #define BLEN_REPRAPWORLD_KEYPAD_UP      6
101
-  #define BLEN_REPRAPWORLD_KEYPAD_LEFT    7
102
-
103
-  #define EN_REPRAPWORLD_KEYPAD_F1        (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1))
104
-  #define EN_REPRAPWORLD_KEYPAD_F2        (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2))
105
-  #define EN_REPRAPWORLD_KEYPAD_F3        (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3))
106
-  #define EN_REPRAPWORLD_KEYPAD_DOWN      (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_DOWN))
107
-  #define EN_REPRAPWORLD_KEYPAD_RIGHT     (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_RIGHT))
108
-  #define EN_REPRAPWORLD_KEYPAD_MIDDLE    (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
109
-  #define EN_REPRAPWORLD_KEYPAD_UP        (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP))
110
-  #define EN_REPRAPWORLD_KEYPAD_LEFT      (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT))
93
+  #define BTN_OFFSET          0 // Bit offset into buttons for shift register values
94
+
95
+  #define BLEN_KEYPAD_F3      0
96
+  #define BLEN_KEYPAD_F2      1
97
+  #define BLEN_KEYPAD_F1      2
98
+  #define BLEN_KEYPAD_DOWN    3
99
+  #define BLEN_KEYPAD_RIGHT   4
100
+  #define BLEN_KEYPAD_MIDDLE  5
101
+  #define BLEN_KEYPAD_UP      6
102
+  #define BLEN_KEYPAD_LEFT    7
103
+
104
+  #define EN_KEYPAD_F1      _BV(BTN_OFFSET + BLEN_KEYPAD_F1)
105
+  #define EN_KEYPAD_F2      _BV(BTN_OFFSET + BLEN_KEYPAD_F2)
106
+  #define EN_KEYPAD_F3      _BV(BTN_OFFSET + BLEN_KEYPAD_F3)
107
+  #define EN_KEYPAD_DOWN    _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN)
108
+  #define EN_KEYPAD_RIGHT   _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT)
109
+  #define EN_KEYPAD_MIDDLE  _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE)
110
+  #define EN_KEYPAD_UP      _BV(BTN_OFFSET + BLEN_KEYPAD_UP)
111
+  #define EN_KEYPAD_LEFT    _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT)
111
 
112
 
112
   #define RRK(B) (keypad_buttons & (B))
113
   #define RRK(B) (keypad_buttons & (B))
114
+
115
+  #ifdef EN_C
116
+    #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE))
117
+  #else
118
+    #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE)
119
+  #endif
120
+
113
 #endif
121
 #endif
114
 
122
 
115
 #if HAS_DIGITAL_BUTTONS
123
 #if HAS_DIGITAL_BUTTONS
129
     #define EN_C _BV(BLEN_C)
137
     #define EN_C _BV(BLEN_C)
130
   #endif
138
   #endif
131
 
139
 
132
-  #if BUTTON_EXISTS(BACK)
133
-    #define BLEN_D 3
134
-    #define EN_D _BV(BLEN_D)
135
-    #define LCD_BACK_CLICKED() (buttons & EN_D)
136
-  #endif
137
-
138
-  #if ENABLED(REPRAPWORLD_KEYPAD)
139
-
140
-    #ifdef EN_C
141
-      #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE))
142
-    #else
143
-      #define BUTTON_CLICK() RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE)
144
-    #endif
145
-
146
-  #elif ENABLED(LCD_I2C_VIKI)
140
+  #if ENABLED(LCD_I2C_VIKI)
147
 
141
 
148
     #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
142
     #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
149
 
143
 
150
     // button and encoder bit positions within 'buttons'
144
     // button and encoder bit positions within 'buttons'
151
-    #define B_LE (BUTTON_LEFT   << B_I2C_BTN_OFFSET)    // The remaining normalized buttons are all read via I2C
145
+    #define B_LE (BUTTON_LEFT   << B_I2C_BTN_OFFSET)      // The remaining normalized buttons are all read via I2C
152
     #define B_UP (BUTTON_UP     << B_I2C_BTN_OFFSET)
146
     #define B_UP (BUTTON_UP     << B_I2C_BTN_OFFSET)
153
     #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET)
147
     #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET)
154
     #define B_DW (BUTTON_DOWN   << B_I2C_BTN_OFFSET)
148
     #define B_DW (BUTTON_DOWN   << B_I2C_BTN_OFFSET)
156
 
150
 
157
     #if BUTTON_EXISTS(ENC)                                // The pause/stop/restart button is connected to BTN_ENC when used
151
     #if BUTTON_EXISTS(ENC)                                // The pause/stop/restart button is connected to BTN_ENC when used
158
       #define B_ST (EN_C)                                 // Map the pause/stop/resume button into its normalized functional name
152
       #define B_ST (EN_C)                                 // Map the pause/stop/resume button into its normalized functional name
159
-      #define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST))  // Pause/stop also acts as click until a proper pause/stop is implemented.
153
+      #define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented.
160
     #else
154
     #else
161
       #define BUTTON_CLICK() (buttons & (B_MI|B_RI))
155
       #define BUTTON_CLICK() (buttons & (B_MI|B_RI))
162
     #endif
156
     #endif
163
 
157
 
164
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
158
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
165
-    #define LCD_HAS_SLOW_BUTTONS
166
 
159
 
167
   #elif ENABLED(LCD_I2C_PANELOLU2)
160
   #elif ENABLED(LCD_I2C_PANELOLU2)
168
 
161
 
174
 
167
 
175
       #define BUTTON_CLICK() (buttons & B_MI)
168
       #define BUTTON_CLICK() (buttons & B_MI)
176
 
169
 
177
-      // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
178
-      #define LCD_HAS_SLOW_BUTTONS
179
-
180
     #endif
170
     #endif
181
 
171
 
182
   #endif
172
   #endif
183
 
173
 
184
 #else
174
 #else
185
 
175
 
186
-  #define BUTTON_EXISTS(BN) 0
176
+  #define BUTTON_EXISTS(BN) false
187
 
177
 
188
   // Shift register bits correspond to buttons:
178
   // Shift register bits correspond to buttons:
189
   #define BL_LE 7   // Left
179
   #define BL_LE 7   // Left
202
 
192
 
203
 #endif
193
 #endif
204
 
194
 
195
+#if BUTTON_EXISTS(BACK)
196
+  #define BLEN_D 3
197
+  #define EN_D _BV(BLEN_D)
198
+  #define LCD_BACK_CLICKED() (buttons & EN_D)
199
+#else
200
+  #define LCD_BACK_CLICKED() false
201
+#endif
202
+
205
 #ifndef BUTTON_CLICK
203
 #ifndef BUTTON_CLICK
206
   #ifdef EN_C
204
   #ifdef EN_C
207
     #define BUTTON_CLICK() (buttons & EN_C)
205
     #define BUTTON_CLICK() (buttons & EN_C)
471
       static volatile uint8_t keypad_buttons;
469
       static volatile uint8_t keypad_buttons;
472
       static bool handle_keypad();
470
       static bool handle_keypad();
473
     #endif
471
     #endif
474
-    #if ENABLED(LCD_HAS_SLOW_BUTTONS)
472
+    #if HAS_SLOW_BUTTONS
475
       static volatile uint8_t slow_buttons;
473
       static volatile uint8_t slow_buttons;
476
       static uint8_t read_slow_buttons();
474
       static uint8_t read_slow_buttons();
477
     #endif
475
     #endif

Loading…
取消
儲存