Browse Source

Merge pull request #1551 from thinkyhead/redundant_encrot

Cleanup rotary encoder encrot* defines
Scott Lahteine 10 years ago
parent
commit
d052a3c6aa

+ 7
- 11
Marlin/dogm_lcd_implementation.h View File

21
 **/
21
 **/
22
 
22
 
23
 #ifdef ULTIPANEL
23
 #ifdef ULTIPANEL
24
-#define BLEN_A 0
25
-#define BLEN_B 1
26
-#define BLEN_C 2
27
-#define EN_A (1<<BLEN_A)
28
-#define EN_B (1<<BLEN_B)
29
-#define EN_C (1<<BLEN_C)
30
-#define encrot0 0
31
-#define encrot1 2
32
-#define encrot2 3
33
-#define encrot3 1
34
-#define LCD_CLICKED (buttons&EN_C)
24
+  #define BLEN_A 0
25
+  #define BLEN_B 1
26
+  #define BLEN_C 2
27
+  #define EN_A (1<<BLEN_A)
28
+  #define EN_B (1<<BLEN_B)
29
+  #define EN_C (1<<BLEN_C)
30
+  #define LCD_CLICKED (buttons&EN_C)
35
 #endif
31
 #endif
36
 
32
 
37
 #include <U8glib.h>
33
 #include <U8glib.h>

+ 0
- 6
Marlin/pins_CHEAPTRONIC.h View File

87
 
87
 
88
 // Cheaptronic v1.0 does not use this port
88
 // Cheaptronic v1.0 does not use this port
89
 #define SDCARDDETECT -1
89
 #define SDCARDDETECT -1
90
-
91
-// Encoder rotation values
92
-#define encrot0 0
93
-#define encrot1 2
94
-#define encrot2 3
95
-#define encrot3 1

+ 0
- 6
Marlin/pins_ELEFU_3.h View File

74
   #define BLEN_B           1
74
   #define BLEN_B           1
75
   #define BLEN_A           0
75
   #define BLEN_A           0
76
 
76
 
77
-  //encoder rotation values
78
-  #define encrot0          0
79
-  #define encrot1          2
80
-  #define encrot2          3
81
-  #define encrot3          1
82
-
83
 #endif // RA_CONTROL_PANEL
77
 #endif // RA_CONTROL_PANEL
84
 
78
 
85
 #ifdef RA_DISCO
79
 #ifdef RA_DISCO

+ 0
- 6
Marlin/pins_MEGATRONICS.h View File

83
 
83
 
84
   #define SDCARDDETECT -1   // Ramps does not use this port
84
   #define SDCARDDETECT -1   // Ramps does not use this port
85
 
85
 
86
-    //encoder rotation values
87
-  #define encrot0 0
88
-  #define encrot1 2
89
-  #define encrot2 3
90
-  #define encrot3 1
91
-
92
 #endif // ULTRA_LCD && NEWPANEL
86
 #endif // ULTRA_LCD && NEWPANEL

+ 0
- 6
Marlin/pins_MEGATRONICS_1.h View File

80
 #define BLEN_A 0
80
 #define BLEN_A 0
81
 
81
 
82
 #define SDCARDDETECT -1  // Megatronics does not use this port
82
 #define SDCARDDETECT -1  // Megatronics does not use this port
83
-
84
-// Encoder rotation values
85
-#define encrot0 0
86
-#define encrot1 2
87
-#define encrot2 3
88
-#define encrot3 1

+ 0
- 6
Marlin/pins_MEGATRONICS_2.h View File

95
 #define BLEN_A 0
95
 #define BLEN_A 0
96
 
96
 
97
 #define SDCARDDETECT -1  // Megatronics does not use this port
97
 #define SDCARDDETECT -1  // Megatronics does not use this port
98
-
99
-// Encoder rotation values
100
-#define encrot0 0
101
-#define encrot1 2
102
-#define encrot2 3
103
-#define encrot3 1

+ 0
- 6
Marlin/pins_MEGATRONICS_3.h View File

95
 #define BLEN_A 0
95
 #define BLEN_A 0
96
 
96
 
97
 #define SDCARDDETECT -1	// Megatronics does not use this port
97
 #define SDCARDDETECT -1	// Megatronics does not use this port
98
-
99
-// Encoder rotation values
100
-#define encrot0 0
101
-#define encrot1 2
102
-#define encrot2 3
103
-#define encrot3 1

+ 0
- 11
Marlin/pins_RAMBO.h View File

116
 
116
 
117
     #define SDCARDDETECT 81    // Ramps does not use this port
117
     #define SDCARDDETECT 81    // Ramps does not use this port
118
 
118
 
119
-    //encoder rotation values
120
-    #define encrot0 0
121
-    #define encrot1 2
122
-    #define encrot2 3
123
-    #define encrot3 1
124
   #else //!NEWPANEL - old style panel with shift register
119
   #else //!NEWPANEL - old style panel with shift register
125
     //arduino pin witch triggers an piezzo beeper
120
     //arduino pin witch triggers an piezzo beeper
126
     #define BEEPER 33    No Beeper added
121
     #define BEEPER 33    No Beeper added
138
     #define LCD_PINS_D6 27
133
     #define LCD_PINS_D6 27
139
     #define LCD_PINS_D7 29
134
     #define LCD_PINS_D7 29
140
 
135
 
141
-    //encoder rotation values
142
-    #define encrot0 0
143
-    #define encrot1 2
144
-    #define encrot2 3
145
-    #define encrot3 1
146
-
147
     //bits in the shift register that carry the buttons for:
136
     //bits in the shift register that carry the buttons for:
148
     // left up center down right red
137
     // left up center down right red
149
     #define BL_LE 7
138
     #define BL_LE 7

+ 11
- 0
Marlin/ultralcd.cpp View File

1394
 
1394
 
1395
 #ifdef ULTIPANEL
1395
 #ifdef ULTIPANEL
1396
 
1396
 
1397
+////////////////////////
1398
+// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
1399
+// These values are independent of which pins are used for EN_A and EN_B indications
1400
+// The rotary encoder part is also independent to the chipset used for the LCD
1401
+#if defined(EN_A) && defined(EN_B)
1402
+  #define encrot0 0
1403
+  #define encrot1 2
1404
+  #define encrot2 3
1405
+  #define encrot3 1
1406
+#endif 
1407
+
1397
 /* Warning: This function is called from interrupt context */
1408
 /* Warning: This function is called from interrupt context */
1398
 void lcd_buttons_update() {
1409
 void lcd_buttons_update() {
1399
   #ifdef NEWPANEL
1410
   #ifdef NEWPANEL

+ 0
- 11
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

123
   #define LCD_CLICKED (buttons&(B_MI|B_ST))
123
   #define LCD_CLICKED (buttons&(B_MI|B_ST))
124
 #endif
124
 #endif
125
 
125
 
126
-////////////////////////
127
-// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
128
-// These values are independent of which pins are used for EN_A and EN_B indications
129
-// The rotary encoder part is also independent to the chipset used for the LCD
130
-#if defined(EN_A) && defined(EN_B)
131
-    #define encrot0 0
132
-    #define encrot1 2
133
-    #define encrot2 3
134
-    #define encrot3 1
135
-#endif 
136
-
137
 #endif //ULTIPANEL
126
 #endif //ULTIPANEL
138
 
127
 
139
 ////////////////////////////////////
128
 ////////////////////////////////////

Loading…
Cancel
Save