Browse Source

Add parentheses to LCD_CLICKED

Scott Lahteine 6 years ago
parent
commit
eb5600acd2

+ 4
- 4
Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h View File

@@ -60,9 +60,9 @@
60 60
     #if BUTTON_EXISTS(ENC)
61 61
       // the pause/stop/restart button is connected to BTN_ENC when used
62 62
       #define B_ST (EN_C)                            // Map the pause/stop/resume button into its normalized functional name
63
-      #define LCD_CLICKED (buttons & (B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
63
+      #define LCD_CLICKED() (buttons & (B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
64 64
     #else
65
-      #define LCD_CLICKED (buttons & (B_MI|B_RI))
65
+      #define LCD_CLICKED() (buttons & (B_MI|B_RI))
66 66
     #endif
67 67
 
68 68
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
@@ -77,7 +77,7 @@
77 77
       #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
78 78
 
79 79
       #undef LCD_CLICKED
80
-      #define LCD_CLICKED (buttons & B_MI)
80
+      #define LCD_CLICKED() (buttons & B_MI)
81 81
 
82 82
       // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
83 83
       #define LCD_HAS_SLOW_BUTTONS
@@ -98,7 +98,7 @@
98 98
     #define B_DW (_BV(BL_DW))
99 99
     #define B_RI (_BV(BL_RI))
100 100
     #define B_ST (_BV(BL_ST))
101
-    #define LCD_CLICKED (buttons & (B_MI|B_ST))
101
+    #define LCD_CLICKED() (buttons & (B_MI|B_ST))
102 102
   #endif
103 103
 
104 104
   #if ENABLED(AUTO_BED_LEVELING_UBL)

+ 3
- 3
Marlin/src/lcd/ultralcd.cpp View File

@@ -660,7 +660,7 @@ void lcd_update() {
660 660
     // Handle any queued Move Axis motion
661 661
     manage_manual_move();
662 662
 
663
-    // Update button states for LCD_CLICKED, etc.
663
+    // Update button states for LCD_CLICKED(), etc.
664 664
     // After state changes the next button update
665 665
     // may be delayed 300-500ms.
666 666
     lcd_buttons_update();
@@ -673,7 +673,7 @@ void lcd_update() {
673 673
     #endif
674 674
 
675 675
     // If the action button is pressed...
676
-    if (UBL_CONDITION && LCD_CLICKED) {
676
+    if (UBL_CONDITION && LCD_CLICKED()) {
677 677
       if (!wait_for_unclick) {           // If not waiting for a debounce release:
678 678
         wait_for_unclick = true;         //  Set debounce flag to ignore continous clicks
679 679
         lcd_clicked = !wait_for_user && !no_reentry; //  Keep the click if not waiting for a user-click
@@ -1102,7 +1102,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1102 1102
   #endif
1103 1103
 
1104 1104
   #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
1105
-    bool is_lcd_clicked() { return LCD_CLICKED; }
1105
+    bool is_lcd_clicked() { return LCD_CLICKED(); }
1106 1106
     void wait_for_release() {
1107 1107
       while (is_lcd_clicked()) safe_delay(50);
1108 1108
       safe_delay(50);

+ 4
- 4
Marlin/src/lcd/ultralcd.h View File

@@ -409,14 +409,14 @@
409 409
 
410 410
 #if ENABLED(REPRAPWORLD_KEYPAD)
411 411
   #ifdef EN_C
412
-    #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU)
412
+    #define LCD_CLICKED() ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU)
413 413
   #else
414
-    #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU
414
+    #define LCD_CLICKED() REPRAPWORLD_KEYPAD_MOVE_MENU
415 415
   #endif
416 416
 #elif defined(EN_C)
417
-  #define LCD_CLICKED (buttons & EN_C)
417
+  #define LCD_CLICKED() (buttons & EN_C)
418 418
 #else
419
-  #define LCD_CLICKED false
419
+  #define LCD_CLICKED() false
420 420
 #endif
421 421
 
422 422
 extern uint8_t lcd_status_update_delay;

Loading…
Cancel
Save