|
@@ -65,9 +65,6 @@
|
65
|
65
|
#if ENABLED(ULTIPANEL)
|
66
|
66
|
void lcd_buttons_update();
|
67
|
67
|
extern volatile uint8_t buttons; //the last checked buttons in a bit array.
|
68
|
|
- #if ENABLED(REPRAPWORLD_KEYPAD)
|
69
|
|
- extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
|
70
|
|
- #endif
|
71
|
68
|
#else
|
72
|
69
|
FORCE_INLINE void lcd_buttons_update() {}
|
73
|
70
|
#endif
|
|
@@ -89,33 +86,52 @@
|
89
|
86
|
void lcd_ignore_click(bool b=true);
|
90
|
87
|
bool lcd_blink();
|
91
|
88
|
|
|
89
|
+ #if ENABLED(ULTIPANEL) && ENABLED(REPRAPWORLD_KEYPAD)
|
|
90
|
+
|
|
91
|
+ #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values
|
|
92
|
+
|
|
93
|
+ #define BLEN_REPRAPWORLD_KEYPAD_F3 0
|
|
94
|
+ #define BLEN_REPRAPWORLD_KEYPAD_F2 1
|
|
95
|
+ #define BLEN_REPRAPWORLD_KEYPAD_F1 2
|
|
96
|
+ #define BLEN_REPRAPWORLD_KEYPAD_DOWN 3
|
|
97
|
+ #define BLEN_REPRAPWORLD_KEYPAD_RIGHT 4
|
|
98
|
+ #define BLEN_REPRAPWORLD_KEYPAD_MIDDLE 5
|
|
99
|
+ #define BLEN_REPRAPWORLD_KEYPAD_UP 6
|
|
100
|
+ #define BLEN_REPRAPWORLD_KEYPAD_LEFT 7
|
|
101
|
+
|
|
102
|
+ #define EN_REPRAPWORLD_KEYPAD_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3))
|
|
103
|
+ #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2))
|
|
104
|
+ #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1))
|
|
105
|
+ #define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_DOWN))
|
|
106
|
+ #define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_RIGHT))
|
|
107
|
+ #define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
|
|
108
|
+ #define EN_REPRAPWORLD_KEYPAD_UP (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP))
|
|
109
|
+ #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT))
|
|
110
|
+
|
|
111
|
+ #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3)
|
|
112
|
+ #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2)
|
|
113
|
+ #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
|
|
114
|
+ #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
|
|
115
|
+ #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
|
|
116
|
+ #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
|
|
117
|
+ #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
|
|
118
|
+
|
|
119
|
+ #endif //ULTIPANEL && REPRAPWORLD_KEYPAD
|
|
120
|
+
|
92
|
121
|
#if ENABLED(NEWPANEL)
|
|
122
|
+
|
93
|
123
|
#define EN_C (_BV(BLEN_C))
|
94
|
124
|
#define EN_B (_BV(BLEN_B))
|
95
|
125
|
#define EN_A (_BV(BLEN_A))
|
96
|
126
|
|
97
|
127
|
#if ENABLED(REPRAPWORLD_KEYPAD)
|
98
|
|
- #define EN_REPRAPWORLD_KEYPAD_F3 (_BV(BLEN_REPRAPWORLD_KEYPAD_F3))
|
99
|
|
- #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(BLEN_REPRAPWORLD_KEYPAD_F2))
|
100
|
|
- #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(BLEN_REPRAPWORLD_KEYPAD_F1))
|
101
|
|
- #define EN_REPRAPWORLD_KEYPAD_UP (_BV(BLEN_REPRAPWORLD_KEYPAD_UP))
|
102
|
|
- #define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(BLEN_REPRAPWORLD_KEYPAD_RIGHT))
|
103
|
|
- #define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
|
104
|
|
- #define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(BLEN_REPRAPWORLD_KEYPAD_DOWN))
|
105
|
|
- #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(BLEN_REPRAPWORLD_KEYPAD_LEFT))
|
106
|
|
-
|
107
|
128
|
#define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
|
108
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
|
109
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
|
110
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
|
111
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
|
112
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
|
113
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
|
114
|
|
- #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
|
115
|
129
|
#else
|
116
|
130
|
#define LCD_CLICKED (buttons&EN_C)
|
117
|
|
- #endif //REPRAPWORLD_KEYPAD
|
118
|
|
- #else
|
|
131
|
+ #endif
|
|
132
|
+
|
|
133
|
+ #else //!NEWPANEL
|
|
134
|
+
|
119
|
135
|
//atomic, do not change
|
120
|
136
|
#define B_LE (_BV(BL_LE))
|
121
|
137
|
#define B_UP (_BV(BL_UP))
|
|
@@ -127,7 +143,8 @@
|
127
|
143
|
#define EN_A (_BV(BLEN_A))
|
128
|
144
|
|
129
|
145
|
#define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
|
130
|
|
- #endif//NEWPANEL
|
|
146
|
+
|
|
147
|
+ #endif //!NEWPANEL
|
131
|
148
|
|
132
|
149
|
#else //no LCD
|
133
|
150
|
FORCE_INLINE void lcd_update() {}
|