Fix keypad-related compile error (#12306)
This commit is contained in:
@ -408,15 +408,42 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(REPRAPWORLD_KEYPAD)
|
||||
#define REPRAPWORLD_BTN_OFFSET 0 // Bit offset into buttons for shift register values
|
||||
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_F3 0
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_F2 1
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_F1 2
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_DOWN 3
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_RIGHT 4
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_MIDDLE 5
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_UP 6
|
||||
#define BLEN_REPRAPWORLD_KEYPAD_LEFT 7
|
||||
|
||||
#define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1))
|
||||
#define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2))
|
||||
#define EN_REPRAPWORLD_KEYPAD_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3))
|
||||
#define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_DOWN))
|
||||
#define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_RIGHT))
|
||||
#define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
|
||||
#define EN_REPRAPWORLD_KEYPAD_UP (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP))
|
||||
#define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT))
|
||||
|
||||
#define RRK(B) (buttons_reprapworld_keypad & (B))
|
||||
|
||||
#ifdef EN_C
|
||||
#define LCD_CLICKED() ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU)
|
||||
#define LCD_CLICKED() ((buttons & EN_C) || RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE))
|
||||
#else
|
||||
#define LCD_CLICKED() REPRAPWORLD_KEYPAD_MOVE_MENU
|
||||
#define LCD_CLICKED() RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE)
|
||||
#endif
|
||||
|
||||
#endif // REPRAPWORLD_KEYPAD
|
||||
|
||||
#ifndef LCD_CLICKED
|
||||
#ifdef EN_C
|
||||
#define LCD_CLICKED() (buttons & EN_C)
|
||||
#else
|
||||
#define LCD_CLICKED() false
|
||||
#endif
|
||||
#elif defined(EN_C)
|
||||
#define LCD_CLICKED() (buttons & EN_C)
|
||||
#else
|
||||
#define LCD_CLICKED() false
|
||||
#endif
|
||||
|
||||
extern uint8_t lcd_status_update_delay;
|
||||
|
Reference in New Issue
Block a user