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

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

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

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

409
 
409
 
410
 #if ENABLED(REPRAPWORLD_KEYPAD)
410
 #if ENABLED(REPRAPWORLD_KEYPAD)
411
   #ifdef EN_C
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
   #else
413
   #else
414
-    #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU
414
+    #define LCD_CLICKED() REPRAPWORLD_KEYPAD_MOVE_MENU
415
   #endif
415
   #endif
416
 #elif defined(EN_C)
416
 #elif defined(EN_C)
417
-  #define LCD_CLICKED (buttons & EN_C)
417
+  #define LCD_CLICKED() (buttons & EN_C)
418
 #else
418
 #else
419
-  #define LCD_CLICKED false
419
+  #define LCD_CLICKED() false
420
 #endif
420
 #endif
421
 
421
 
422
 extern uint8_t lcd_status_update_delay;
422
 extern uint8_t lcd_status_update_delay;

Loading…
Cancel
Save