Browse Source

Split up Conditionals.h into two files

Rather than include twice, which is tricky but may confuse
Scott Lahteine 8 years ago
parent
commit
93ea281061

+ 16
- 265
Marlin/Conditionals.h View File

@@ -26,273 +26,16 @@
26 26
  */
27 27
 
28 28
 #ifndef CONDITIONALS_H
29
-
30
-/**
31
-* Miscellaneous
32
-*/
33
-#ifndef M_PI
34
-  #define M_PI 3.1415926536
35
-#endif
36
-
37
-/**
38
- * This value is used by M109 when tying to calculate a ballpark safe margin
39
- * to prevent wait-forever situation.
40
- */
41
-#ifndef EXTRUDE_MINTEMP
42
- #define EXTRUDE_MINTEMP 170
43
-#endif
44
-
45
-#ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
46
-#define CONFIGURATION_LCD
47
-
48
-  #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
49
-
50
-  #if ENABLED(CARTESIO_UI)
51
-    #define DOGLCD
52
-    #define ULTIPANEL
53
-    #define NEWPANEL
54
-    #define DEFAULT_LCD_CONTRAST 90
55
-    #define LCD_CONTRAST_MIN 60
56
-    #define LCD_CONTRAST_MAX 140
57
-  #endif
58
-
59
-  #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
60
-    #define DOGLCD
61
-    #define ULTIPANEL
62
-    #define NEWPANEL
63
-    #define DEFAULT_LCD_CONTRAST 17
64
-  #endif
65
-
66
-  #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
67
-    #define ULTRA_LCD  //general LCD support, also 16x2
68
-    #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
69
-    #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
70
-
71
-    #if ENABLED(miniVIKI)
72
-      #define LCD_CONTRAST_MIN  75
73
-      #define LCD_CONTRAST_MAX 115
74
-      #define DEFAULT_LCD_CONTRAST 95
75
-    #elif ENABLED(VIKI2)
76
-      #define DEFAULT_LCD_CONTRAST 40
77
-    #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
78
-      #define LCD_CONTRAST_MIN  90
79
-      #define LCD_CONTRAST_MAX 130
80
-      #define DEFAULT_LCD_CONTRAST 110
81
-      #define U8GLIB_LM6059_AF
82
-      #define SD_DETECT_INVERTED
83
-    #endif
84
-
85
-    #define ENCODER_PULSES_PER_STEP 4
86
-    #define ENCODER_STEPS_PER_MENU_ITEM 1
87
-  #endif
88
-
89
-  // Generic support for SSD1306 / SH1106 OLED based LCDs.
90
-  #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
91
-    #define ULTRA_LCD  //general LCD support, also 16x2
92
-    #define DOGLCD  // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
93
-  #endif
94
-
95
-  #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
96
-    #define ULTIMAKERCONTROLLER
97
-  #endif
98
-
99
-  #if ENABLED(BQ_LCD_SMART_CONTROLLER)
100
-    #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
101
-
102
-    #ifndef ENCODER_PULSES_PER_STEP
103
-      #define ENCODER_PULSES_PER_STEP 4
104
-    #endif
105
-
106
-    #ifndef ENCODER_STEPS_PER_MENU_ITEM
107
-      #define ENCODER_STEPS_PER_MENU_ITEM 1
108
-    #endif
109
-
110
-    #ifndef LONG_FILENAME_HOST_SUPPORT
111
-      #define LONG_FILENAME_HOST_SUPPORT
112
-    #endif
113
-  #endif
114
-
115
-  #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
116
-    #define DOGLCD
117
-    #define U8GLIB_ST7920
118
-    #define REPRAP_DISCOUNT_SMART_CONTROLLER
119
-  #endif
120
-
121
-  #if ENABLED(ULTIMAKERCONTROLLER)              \
122
-   || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
123
-   || ENABLED(G3D_PANEL)                        \
124
-   || ENABLED(RIGIDBOT_PANEL)                   \
125
-   || ENABLED(REPRAPWORLD_KEYPAD)
126
-    #define ULTIPANEL
127
-    #define NEWPANEL
128
-  #endif
129
-
130
-  #if ENABLED(RA_CONTROL_PANEL)
131
-    #define LCD_I2C_TYPE_PCA8574
132
-    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
133
-    #define ULTIPANEL
134
-    #define NEWPANEL
135
-  #endif
136
-
137
-  #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
138
-    #define DOGLCD
139
-    #define U8GLIB_ST7920
140
-    #define ULTIPANEL
141
-    #define NEWPANEL
142
-  #endif
143
-
144
-  /**
145
-   * I2C PANELS
146
-   */
147
-
148
-  #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
149
-    // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
150
-    // Make sure it is placed in the Arduino libraries directory.
151
-    #define LCD_I2C_TYPE_PCF8575
152
-    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
153
-    #define ULTIPANEL
154
-    #define NEWPANEL
155
-  #endif
156
-
157
-  // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
158
-  #if ENABLED(LCD_I2C_PANELOLU2)
159
-    #define LCD_I2C_TYPE_MCP23017
160
-    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
161
-    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
162
-
163
-    #ifndef ENCODER_PULSES_PER_STEP
164
-      #define ENCODER_PULSES_PER_STEP 4
165
-    #endif
166
-
167
-    #ifndef ENCODER_STEPS_PER_MENU_ITEM
168
-      #define ENCODER_STEPS_PER_MENU_ITEM 1
169
-    #endif
170
-
171
-    #define ULTIPANEL
172
-    #define NEWPANEL
173
-  #endif
174
-
175
-  // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
176
-  #if ENABLED(LCD_I2C_VIKI)
177
-    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
178
-    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
179
-    // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
180
-    //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
181
-    #define LCD_I2C_TYPE_MCP23017
182
-    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
183
-    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
184
-    #define ULTIPANEL
185
-    #define NEWPANEL
186
-  #endif
187
-
188
-  // Shift register panels
189
-  // ---------------------
190
-  // 2 wire Non-latching LCD SR from:
191
-  // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
192
-
193
-  #if ENABLED(SAV_3DLCD)
194
-    #define SR_LCD_2W_NL    // Non latching 2 wire shift register
195
-    #define ULTIPANEL
196
-    #define NEWPANEL
197
-  #endif
198
-
199
-  #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
200
-    #ifndef LCD_WIDTH
201
-      #define LCD_WIDTH 22
202
-    #endif
203
-    #ifndef LCD_HEIGHT
204
-      #define LCD_HEIGHT 5
205
-    #endif
206
-  #endif
207
-
208
-  #if ENABLED(ULTIPANEL)
209
-    #define NEWPANEL  //enable this if you have a click-encoder panel
210
-    #define ULTRA_LCD
211
-    #ifndef LCD_WIDTH
212
-      #define LCD_WIDTH 20
213
-    #endif
214
-    #ifndef LCD_HEIGHT
215
-      #define LCD_HEIGHT 4
216
-    #endif
217
-  #else //no panel but just LCD
218
-    #if ENABLED(ULTRA_LCD)
219
-      #ifndef LCD_WIDTH
220
-        #define LCD_WIDTH 16
221
-      #endif
222
-      #ifndef LCD_HEIGHT
223
-        #define LCD_HEIGHT 2
224
-      #endif
225
-    #endif
226
-  #endif
227
-
228
-  #if ENABLED(DOGLCD)
229
-    /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
230
-    // \x00 intentionally skipped to avoid problems in strings
231
-    #define LCD_STR_REFRESH     "\x01"
232
-    #define LCD_STR_FOLDER      "\x02"
233
-    #define LCD_STR_ARROW_RIGHT "\x03"
234
-    #define LCD_STR_UPLEVEL     "\x04"
235
-    #define LCD_STR_CLOCK       "\x05"
236
-    #define LCD_STR_FEEDRATE    "\x06"
237
-    #define LCD_STR_BEDTEMP     "\x07"
238
-    #define LCD_STR_THERMOMETER "\x08"
239
-    #define LCD_STR_DEGREE      "\x09"
240
-
241
-    #define LCD_STR_SPECIAL_MAX '\x09'
242
-    // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
243
-    // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
244
-  #else
245
-    /* Custom characters defined in the first 8 characters of the LCD */
246
-    #define LCD_STR_BEDTEMP     "\x00"  // Print only as a char. This will have 'unexpected' results when used in a string!
247
-    #define LCD_STR_DEGREE      "\x01"
248
-    #define LCD_STR_THERMOMETER "\x02"
249
-    #define LCD_STR_UPLEVEL     "\x03"
250
-    #define LCD_STR_REFRESH     "\x04"
251
-    #define LCD_STR_FOLDER      "\x05"
252
-    #define LCD_STR_FEEDRATE    "\x06"
253
-    #define LCD_STR_CLOCK       "\x07"
254
-    #define LCD_STR_ARROW_RIGHT ">"  /* from the default character set */
255
-  #endif
256
-
257
-  /**
258
-   * Default LCD contrast for dogm-like LCD displays
259
-   */
260
-  #if ENABLED(DOGLCD)
261
-
262
-    #define HAS_LCD_CONTRAST ( \
263
-        ENABLED(MAKRPANEL) \
264
-     || ENABLED(CARTESIO_UI) \
265
-     || ENABLED(VIKI2) \
266
-     || ENABLED(miniVIKI) \
267
-     || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
268
-    )
269
-
270
-    #if HAS_LCD_CONTRAST
271
-      #ifndef LCD_CONTRAST_MIN
272
-        #define LCD_CONTRAST_MIN 0
273
-      #endif
274
-      #ifndef LCD_CONTRAST_MAX
275
-        #define LCD_CONTRAST_MAX 63
276
-      #endif
277
-      #ifndef DEFAULT_LCD_CONTRAST
278
-        #define DEFAULT_LCD_CONTRAST 32
279
-      #endif
280
-    #endif
281
-  #endif
282
-
283
-  #ifndef BOOTSCREEN_TIMEOUT
284
-    #define BOOTSCREEN_TIMEOUT 2500
285
-  #endif
286
-
287
-#else // CONFIGURATION_LCD
288
-
289
-  #define CONDITIONALS_H
29
+#define CONDITIONALS_H
290 30
 
291 31
   #include "pins.h"
292 32
 
293 33
   #ifndef USBCON
294 34
     #define HardwareSerial_h // trick to disable the standard HWserial
295 35
   #endif
36
+  #include "Arduino.h"
37
+
38
+  #include "macros.h"
296 39
 
297 40
   #if ENABLED(EMERGENCY_PARSER)
298 41
     #define EMERGENCY_PARSER_CAPABILITIES " EMERGENCY_CODES:M108,M112,M410"
@@ -300,8 +43,6 @@
300 43
     #define EMERGENCY_PARSER_CAPABILITIES ""
301 44
   #endif
302 45
 
303
-  #include "Arduino.h"
304
-
305 46
   /**
306 47
    * Set ENDSTOPPULLUPS for unused endstop switches
307 48
    */
@@ -747,6 +488,7 @@
747 488
   #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
748 489
   #define HAS_E4_STEP (PIN_EXISTS(E4_STEP))
749 490
   #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
491
+  #define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER))
750 492
 
751 493
   #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
752 494
 
@@ -755,6 +497,14 @@
755 497
   #define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED))
756 498
 
757 499
   /**
500
+   * This value is used by M109 when trying to calculate a ballpark safe margin
501
+   * to prevent wait-forever situation.
502
+   */
503
+  #ifndef EXTRUDE_MINTEMP
504
+   #define EXTRUDE_MINTEMP 170
505
+  #endif
506
+
507
+  /**
758 508
    * Helper Macros for heaters and extruder fan
759 509
    */
760 510
   #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
@@ -801,7 +551,9 @@
801 551
   #endif
802 552
   #define WRITE_FAN_N(n, v) WRITE_FAN##n(v)
803 553
 
804
-  #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER))
554
+  /**
555
+   * Servos and probes
556
+   */
805 557
 
806 558
   #if HAS_SERVOS
807 559
     #ifndef Z_ENDSTOP_SERVO_NR
@@ -923,5 +675,4 @@
923 675
     #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING
924 676
   #endif
925 677
 
926
-#endif //CONFIGURATION_LCD
927 678
 #endif //CONDITIONALS_H

+ 270
- 0
Marlin/Conditionals_LCD.h View File

@@ -0,0 +1,270 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Conditionals_LCD.h
25
+ * LCD Defines that depend on configuration but are not editable.
26
+ */
27
+
28
+#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first
29
+#define CONDITIONALS_LCD_H
30
+
31
+  #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
32
+
33
+  #if ENABLED(CARTESIO_UI)
34
+    #define DOGLCD
35
+    #define ULTIPANEL
36
+    #define NEWPANEL
37
+    #define DEFAULT_LCD_CONTRAST 90
38
+    #define LCD_CONTRAST_MIN 60
39
+    #define LCD_CONTRAST_MAX 140
40
+  #endif
41
+
42
+  #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
43
+    #define DOGLCD
44
+    #define ULTIPANEL
45
+    #define NEWPANEL
46
+    #define DEFAULT_LCD_CONTRAST 17
47
+  #endif
48
+
49
+  #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
50
+    #define ULTRA_LCD  //general LCD support, also 16x2
51
+    #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
52
+    #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
53
+
54
+    #if ENABLED(miniVIKI)
55
+      #define LCD_CONTRAST_MIN  75
56
+      #define LCD_CONTRAST_MAX 115
57
+      #define DEFAULT_LCD_CONTRAST 95
58
+    #elif ENABLED(VIKI2)
59
+      #define DEFAULT_LCD_CONTRAST 40
60
+    #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
61
+      #define LCD_CONTRAST_MIN  90
62
+      #define LCD_CONTRAST_MAX 130
63
+      #define DEFAULT_LCD_CONTRAST 110
64
+      #define U8GLIB_LM6059_AF
65
+      #define SD_DETECT_INVERTED
66
+    #endif
67
+
68
+    #define ENCODER_PULSES_PER_STEP 4
69
+    #define ENCODER_STEPS_PER_MENU_ITEM 1
70
+  #endif
71
+
72
+  // Generic support for SSD1306 / SH1106 OLED based LCDs.
73
+  #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
74
+    #define ULTRA_LCD  //general LCD support, also 16x2
75
+    #define DOGLCD  // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
76
+  #endif
77
+
78
+  #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
79
+    #define ULTIMAKERCONTROLLER
80
+  #endif
81
+
82
+  #if ENABLED(BQ_LCD_SMART_CONTROLLER)
83
+    #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
84
+
85
+    #ifndef ENCODER_PULSES_PER_STEP
86
+      #define ENCODER_PULSES_PER_STEP 4
87
+    #endif
88
+
89
+    #ifndef ENCODER_STEPS_PER_MENU_ITEM
90
+      #define ENCODER_STEPS_PER_MENU_ITEM 1
91
+    #endif
92
+
93
+    #ifndef LONG_FILENAME_HOST_SUPPORT
94
+      #define LONG_FILENAME_HOST_SUPPORT
95
+    #endif
96
+  #endif
97
+
98
+  #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
99
+    #define DOGLCD
100
+    #define U8GLIB_ST7920
101
+    #define REPRAP_DISCOUNT_SMART_CONTROLLER
102
+  #endif
103
+
104
+  #if ENABLED(ULTIMAKERCONTROLLER)              \
105
+   || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
106
+   || ENABLED(G3D_PANEL)                        \
107
+   || ENABLED(RIGIDBOT_PANEL)                   \
108
+   || ENABLED(REPRAPWORLD_KEYPAD)
109
+    #define ULTIPANEL
110
+    #define NEWPANEL
111
+  #endif
112
+
113
+  #if ENABLED(RA_CONTROL_PANEL)
114
+    #define LCD_I2C_TYPE_PCA8574
115
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
116
+    #define ULTIPANEL
117
+    #define NEWPANEL
118
+  #endif
119
+
120
+  #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
121
+    #define DOGLCD
122
+    #define U8GLIB_ST7920
123
+    #define ULTIPANEL
124
+    #define NEWPANEL
125
+  #endif
126
+
127
+  /**
128
+   * I2C PANELS
129
+   */
130
+
131
+  #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
132
+    // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
133
+    // Make sure it is placed in the Arduino libraries directory.
134
+    #define LCD_I2C_TYPE_PCF8575
135
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
136
+    #define ULTIPANEL
137
+    #define NEWPANEL
138
+  #endif
139
+
140
+  // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
141
+  #if ENABLED(LCD_I2C_PANELOLU2)
142
+    #define LCD_I2C_TYPE_MCP23017
143
+    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
144
+    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
145
+
146
+    #ifndef ENCODER_PULSES_PER_STEP
147
+      #define ENCODER_PULSES_PER_STEP 4
148
+    #endif
149
+
150
+    #ifndef ENCODER_STEPS_PER_MENU_ITEM
151
+      #define ENCODER_STEPS_PER_MENU_ITEM 1
152
+    #endif
153
+
154
+    #define ULTIPANEL
155
+    #define NEWPANEL
156
+  #endif
157
+
158
+  // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
159
+  #if ENABLED(LCD_I2C_VIKI)
160
+    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
161
+    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
162
+    // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
163
+    //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
164
+    #define LCD_I2C_TYPE_MCP23017
165
+    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
166
+    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
167
+    #define ULTIPANEL
168
+    #define NEWPANEL
169
+  #endif
170
+
171
+  // Shift register panels
172
+  // ---------------------
173
+  // 2 wire Non-latching LCD SR from:
174
+  // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
175
+
176
+  #if ENABLED(SAV_3DLCD)
177
+    #define SR_LCD_2W_NL    // Non latching 2 wire shift register
178
+    #define ULTIPANEL
179
+    #define NEWPANEL
180
+  #endif
181
+
182
+  #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
183
+    #ifndef LCD_WIDTH
184
+      #define LCD_WIDTH 22
185
+    #endif
186
+    #ifndef LCD_HEIGHT
187
+      #define LCD_HEIGHT 5
188
+    #endif
189
+  #endif
190
+
191
+  #if ENABLED(ULTIPANEL)
192
+    #define NEWPANEL  //enable this if you have a click-encoder panel
193
+    #define ULTRA_LCD
194
+    #ifndef LCD_WIDTH
195
+      #define LCD_WIDTH 20
196
+    #endif
197
+    #ifndef LCD_HEIGHT
198
+      #define LCD_HEIGHT 4
199
+    #endif
200
+  #else //no panel but just LCD
201
+    #if ENABLED(ULTRA_LCD)
202
+      #ifndef LCD_WIDTH
203
+        #define LCD_WIDTH 16
204
+      #endif
205
+      #ifndef LCD_HEIGHT
206
+        #define LCD_HEIGHT 2
207
+      #endif
208
+    #endif
209
+  #endif
210
+
211
+  #if ENABLED(DOGLCD)
212
+    /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
213
+    // \x00 intentionally skipped to avoid problems in strings
214
+    #define LCD_STR_REFRESH     "\x01"
215
+    #define LCD_STR_FOLDER      "\x02"
216
+    #define LCD_STR_ARROW_RIGHT "\x03"
217
+    #define LCD_STR_UPLEVEL     "\x04"
218
+    #define LCD_STR_CLOCK       "\x05"
219
+    #define LCD_STR_FEEDRATE    "\x06"
220
+    #define LCD_STR_BEDTEMP     "\x07"
221
+    #define LCD_STR_THERMOMETER "\x08"
222
+    #define LCD_STR_DEGREE      "\x09"
223
+
224
+    #define LCD_STR_SPECIAL_MAX '\x09'
225
+    // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
226
+    // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
227
+  #else
228
+    /* Custom characters defined in the first 8 characters of the LCD */
229
+    #define LCD_STR_BEDTEMP     "\x00"  // Print only as a char. This will have 'unexpected' results when used in a string!
230
+    #define LCD_STR_DEGREE      "\x01"
231
+    #define LCD_STR_THERMOMETER "\x02"
232
+    #define LCD_STR_UPLEVEL     "\x03"
233
+    #define LCD_STR_REFRESH     "\x04"
234
+    #define LCD_STR_FOLDER      "\x05"
235
+    #define LCD_STR_FEEDRATE    "\x06"
236
+    #define LCD_STR_CLOCK       "\x07"
237
+    #define LCD_STR_ARROW_RIGHT ">"  /* from the default character set */
238
+  #endif
239
+
240
+  /**
241
+   * Default LCD contrast for dogm-like LCD displays
242
+   */
243
+  #if ENABLED(DOGLCD)
244
+
245
+    #define HAS_LCD_CONTRAST ( \
246
+        ENABLED(MAKRPANEL) \
247
+     || ENABLED(CARTESIO_UI) \
248
+     || ENABLED(VIKI2) \
249
+     || ENABLED(miniVIKI) \
250
+     || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
251
+    )
252
+
253
+    #if HAS_LCD_CONTRAST
254
+      #ifndef LCD_CONTRAST_MIN
255
+        #define LCD_CONTRAST_MIN 0
256
+      #endif
257
+      #ifndef LCD_CONTRAST_MAX
258
+        #define LCD_CONTRAST_MAX 63
259
+      #endif
260
+      #ifndef DEFAULT_LCD_CONTRAST
261
+        #define DEFAULT_LCD_CONTRAST 32
262
+      #endif
263
+    #endif
264
+  #endif
265
+
266
+  #ifndef BOOTSCREEN_TIMEOUT
267
+    #define BOOTSCREEN_TIMEOUT 2500
268
+  #endif
269
+
270
+#endif //CONDITIONALS_LCD_H

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -52,7 +52,7 @@
52 52
  */
53 53
 #define CONFIGURATION_ADV_H_VERSION 010100
54 54
 
55
-#include "Conditionals.h"
55
+#include "Conditionals_LCD.h"
56 56
 
57 57
 // @section temperature
58 58
 

+ 1
- 1
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -51,7 +51,7 @@
51 51
  */
52 52
 #define CONFIGURATION_ADV_H_VERSION 010100
53 53
 
54
-#include "Conditionals.h"
54
+#include "Conditionals_LCD.h"
55 55
 
56 56
 // @section temperature
57 57
 

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -46,7 +46,7 @@
46 46
  */
47 47
 #define CONFIGURATION_ADV_H_VERSION 010100
48 48
 
49
-#include "Conditionals.h"
49
+#include "Conditionals_LCD.h"
50 50
 
51 51
 // @section temperature
52 52
 

+ 3
- 0
Marlin/macros.h View File

@@ -34,6 +34,9 @@
34 34
 #define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b))
35 35
 
36 36
 // Macros for maths shortcuts
37
+#ifndef M_PI
38
+  #define M_PI 3.14159265358979323846
39
+#endif
37 40
 #define RADIANS(d) ((d)*M_PI/180.0)
38 41
 #define DEGREES(r) ((r)*180.0/M_PI)
39 42
 #define HYPOT(x,y) sqrt(sq(x)+sq(y))

Loading…
Cancel
Save