Selaa lähdekoodia

Better Sanguinololu & Graphical Controller (PR#2504)

- Change suggested at
https://github.com/MarlinFirmware/Marlin/issues/2482#issuecomment-123553
266
Scott Lahteine 9 vuotta sitten
vanhempi
commit
f7e7862588
1 muutettua tiedostoa jossa 111 lisäystä ja 98 poistoa
  1. 111
    98
      Marlin/pins_SANGUINOLOLU_11.h

+ 111
- 98
Marlin/pins_SANGUINOLOLU_11.h Näytä tiedosto

@@ -14,34 +14,23 @@
14 14
 #define Y_DIR_PIN          23
15 15
 #define Y_STOP_PIN         19
16 16
 
17
-#define Z_STEP_PIN         3
18
-#define Z_DIR_PIN          2
17
+#define Z_STEP_PIN          3
18
+#define Z_DIR_PIN           2
19 19
 #define Z_STOP_PIN         20
20 20
 
21 21
 #define E0_STEP_PIN         1
22 22
 #define E0_DIR_PIN          0
23 23
 
24 24
 #define LED_PIN            -1
25
-
26 25
 #define FAN_PIN            -1
27 26
 
28
-// #if FAN_PIN == 12 || FAN_PIN ==13
29
-//   #define FAN_SOFT_PWM
30
-// #endif
31
-
32
-#if MB(MELZI)
33
-  #define LED_PIN            27 /* On some broken versions of the Sanguino libraries the pin definitions are wrong, which then needs LED_PIN as pin 28. But you better upgrade your Sanguino libraries! See #368. */
34
-  #define FAN_PIN            4 // Works for Panelolu2 too
35
-#endif
36
-
37
-#if MB(STB_11)
38
-  #define FAN_PIN            4
39
-  //  Uncomment this if you have the first generation (V1.10) of STBs board
40
-  #define LCD_PIN_BL         17 // LCD backlight LED
41
-#endif
42
-
43
-#if MB(AZTEEG_X1)
44
-  #define FAN_PIN            4
27
+#if MB(AZTEEG_X1) || MB(STB_11) || MB(MELZI)
28
+  #define FAN_PIN           4 // Works for Panelolu2 too
29
+  #if MB(MELZI)
30
+    #define LED_PIN        27 // On some broken versions of the Sanguino libraries the pin definitions are wrong, so LED_PIN needs to be 28. But you should upgrade your Sanguino libraries! See #368.
31
+  #elif MB(STB_11)
32
+    #define LCD_PIN_BL     17 // LCD backlight LED
33
+  #endif
45 34
 #endif
46 35
 
47 36
 #ifdef Z_PROBE_SLED
@@ -49,13 +38,13 @@
49 38
 #endif
50 39
 
51 40
 #ifdef NUM_SERVOS
52
-  #define SERVO0_PIN          -1
41
+  #define SERVO0_PIN       -1
53 42
   #if NUM_SERVOS > 1
54
-    #define SERVO1_PIN        -1
43
+    #define SERVO1_PIN     -1
55 44
     #if NUM_SERVOS > 2
56
-      #define SERVO2_PIN      -1
45
+      #define SERVO2_PIN   -1
57 46
       #if NUM_SERVOS > 3
58
-        #define SERVO3_PIN    -1
47
+        #define SERVO3_PIN -1
59 48
       #endif
60 49
     #endif
61 50
   #endif
@@ -70,23 +59,23 @@
70 59
 
71 60
 #ifdef SANGUINOLOLU_V_1_2
72 61
 
73
-  #define HEATER_BED_PIN     12 // (bed)
74
-  #define X_ENABLE_PIN       14
75
-  #define Y_ENABLE_PIN       14
76
-  #define Z_ENABLE_PIN       26
77
-  #define E0_ENABLE_PIN      14
62
+  #define HEATER_BED_PIN   12 // (bed)
63
+  #define X_ENABLE_PIN     14
64
+  #define Y_ENABLE_PIN     14
65
+  #define Z_ENABLE_PIN     26
66
+  #define E0_ENABLE_PIN    14
78 67
 
79 68
   #ifdef LCD_I2C_PANELOLU2
80
-    #define FAN_PIN          4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
69
+    #define FAN_PIN         4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
81 70
   #endif
82 71
 
83 72
 #else
84 73
 
85
-  #define HEATER_BED_PIN      14  // (bed)
86
-  #define X_ENABLE_PIN       -1
87
-  #define Y_ENABLE_PIN       -1
88
-  #define Z_ENABLE_PIN       -1
89
-  #define E0_ENABLE_PIN      -1
74
+  #define HEATER_BED_PIN   14  // (bed)
75
+  #define X_ENABLE_PIN     -1
76
+  #define Y_ENABLE_PIN     -1
77
+  #define Z_ENABLE_PIN     -1
78
+  #define E0_ENABLE_PIN    -1
90 79
 
91 80
 #endif
92 81
 
@@ -97,77 +86,101 @@
97 86
 #define SDPOWER            -1
98 87
 #define SDSS               31
99 88
 
100
-/* On some broken versions of the Sanguino libraries the pin definitions are wrong, which then needs SDSS as pin 24. But you better upgrade your Sanguino libraries! See #368. */
89
+/**
90
+ * On some broken versions of the Sanguino libraries the pin definitions are wrong,
91
+ * which then needs SDSS as pin 24. But you should upgrade your Sanguino libraries! See #368.
92
+ */
101 93
 //#define SDSS               24
102 94
 
103
-#ifdef ULTRA_LCD
104
- #ifdef NEWPANEL
105
-   //we have no buzzer installed
106
-   #define BEEPER -1
107
-   //LCD Pins
108
-   #ifdef DOGLCD
109
-   #ifdef U8GLIB_ST7920 //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
110
-     #define LCD_PINS_RS 30 //CS chip select /SS chip slave select
111
-     #define LCD_PINS_ENABLE 29 //SID (MOSI)
112
-     #define LCD_PINS_D4 17 //SCK (CLK) clock
113
-     #define BEEPER 27 // Pin 27 is take by LED_Pin, but Melzi LED do nothing with Marlin and I take this pin for BEEPER.... See here > [github.com] , If you want use this pin with Gcode M42 instead BEEPER
114
-   #else
115
-     // Pins for DOGM SPI LCD Support
116
-     #define DOGLCD_A0 30
117
-     #define DOGLCD_CS 29
118
-     #define LCD_CONTRAST 1
119
-   #endif
120
-     // Uncomment screen orientation
121
-     #define LCD_SCREEN_ROT_0
122
-       // #define LCD_SCREEN_ROT_90
123
-       // #define LCD_SCREEN_ROT_180
124
-       // #define LCD_SCREEN_ROT_270
125
-     #else // standard Hitachi LCD controller
126
-     #define LCD_PINS_RS        4
127
-     #define LCD_PINS_ENABLE    17
128
-     #define LCD_PINS_D4        30
129
-     #define LCD_PINS_D5        29
130
-     #define LCD_PINS_D6        28
131
-     #define LCD_PINS_D7        27
132
-   #endif
133
-   //The encoder and click button
134
-   #define BTN_EN1 11
135
-   #define BTN_EN2 10
136
-   #ifdef LCD_I2C_PANELOLU2
137
-     #if MB(MELZI)
138
-       #define BTN_ENC 29 //the click switch
139
-       #define LCD_SDSS 30 //to use the SD card reader on the Panelolu2 rather than the melzi board
140
-     #else
141
-       #define BTN_ENC 30 //the click switch
142
-     #endif
143
-   #else
144
-     #define BTN_ENC 16  //the click switch
145
-     #define LCD_SDSS 28 //to use the SD card reader on the smart controller rather than the melzi board
146
-   #endif //Panelolu2
147
-   //not connected to a pin
148
-   #define SDCARDDETECT -1
149
-
150
- #endif //NEWPANEL
151
-#endif //ULTRA_LCD
152
-
153
-#ifdef MAKRPANEL
154
-  #define BEEPER 29
95
+#if defined(ULTRA_LCD) && defined(NEWPANEL)
96
+
97
+  // No buzzer installed
98
+  #define BEEPER -1
99
+
100
+  // LCD Pins
101
+  #ifdef DOGLCD
102
+
103
+    #ifdef U8GLIB_ST7920 //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
104
+
105
+      #if MB(MELZI) // Melzi board
106
+        #define LCD_PINS_RS     30 //CS chip select /SS chip slave select
107
+        #define LCD_PINS_ENABLE 29 //SID (MOSI)
108
+        #define LCD_PINS_D4     17 //SCK (CLK) clock
109
+        #define BEEPER          27 // Pin 27 is take by LED_Pin, but Melzi LED do nothing with Marlin and I take this pin for BEEPER.... See here > [github.com] , If you want use this pin with Gcode M42 instead BEEPER
110
+      #else         // Sanguinololu 1.3
111
+        #define LCD_PINS_RS      4 
112
+        #define LCD_PINS_ENABLE 17 
113
+        #define LCD_PINS_D4     30 
114
+        #define LCD_PINS_D5     29
115
+        #define LCD_PINS_D6     28
116
+        #define LCD_PINS_D7     27
117
+      #endif
118
+
119
+    #else // DOGM SPI LCD Support
120
+
121
+      #define DOGLCD_A0         30
122
+      #define DOGLCD_CS         29
123
+      #define LCD_CONTRAST       1
124
+
125
+    #endif
126
+  
127
+    // Uncomment screen orientation
128
+    #define LCD_SCREEN_ROT_0
129
+    // #define LCD_SCREEN_ROT_90
130
+    // #define LCD_SCREEN_ROT_180
131
+    // #define LCD_SCREEN_ROT_270
132
+
133
+  #else // !DOGLCD - Standard Hitachi LCD controller
134
+
135
+    #define LCD_PINS_RS          4
136
+    #define LCD_PINS_ENABLE     17
137
+    #define LCD_PINS_D4         30
138
+    #define LCD_PINS_D5         29
139
+    #define LCD_PINS_D6         28
140
+    #define LCD_PINS_D7         27
141
+
142
+  #endif // !DOGLCD
143
+
144
+  //The encoder and click button
145
+  #define BTN_EN1               11
146
+  #define BTN_EN2               10
147
+  #ifdef LCD_I2C_PANELOLU2
148
+    #if MB(MELZI)
149
+      #define BTN_ENC           29
150
+      #define LCD_SDSS          30 // Panelolu2 SD card reader rather than the Melzi
151
+    #else
152
+      #define BTN_ENC           30
153
+    #endif
154
+  #else
155
+    #define BTN_ENC             16
156
+    #define LCD_SDSS            28 // Smart Controller SD card reader rather than the Melzi
157
+  #endif //Panelolu2
158
+
159
+  #define SDCARDDETECT          -1
160
+
161
+#elif defined(MAKRPANEL)
162
+
163
+  #define BEEPER                29
155 164
   // Pins for DOGM SPI LCD Support
156
-  #define DOGLCD_A0  30
157
-  #define DOGLCD_CS  17
158
-  #define LCD_PIN_BL 28  // backlight LED on PA3
165
+  #define DOGLCD_A0             30
166
+  #define DOGLCD_CS             17
167
+  #define LCD_PIN_BL            28 // backlight LED on PA3
159 168
   // GLCD features
160
-  #define LCD_CONTRAST 1
169
+  #define LCD_CONTRAST           1
161 170
   // Uncomment screen orientation
162 171
   #define LCD_SCREEN_ROT_0
163 172
   // #define LCD_SCREEN_ROT_90
164 173
   // #define LCD_SCREEN_ROT_180
165 174
   // #define LCD_SCREEN_ROT_270
166 175
   //The encoder and click button
167
-  #define BTN_EN1 11
168
-  #define BTN_EN2 10
169
-  #define BTN_ENC 16  //the click switch
170
-  //not connected to a pin
171
-  #define SDCARDDETECT -1
172
-#endif //Makrpanel
176
+  #define BTN_EN1               11
177
+  #define BTN_EN2               10
178
+  #define BTN_ENC               16
179
+
180
+  #define SDCARDDETECT          -1
173 181
 
182
+#endif // MAKRPANEL
183
+
184
+// #if FAN_PIN == 12 || FAN_PIN ==13
185
+//   #define FAN_SOFT_PWM
186
+// #endif

Loading…
Peruuta
Tallenna