Преглед изворни кода

Include Conditionals.h file in update

Scott Lahteine пре 9 година
родитељ
комит
19df90622b
1 измењених фајлова са 405 додато и 0 уклоњено
  1. 405
    0
      Marlin/Conditionals.h

+ 405
- 0
Marlin/Conditionals.h Прегледај датотеку

@@ -0,0 +1,405 @@
1
+/**
2
+ * Conditionals.h
3
+ * Defines that depend on configuration but are not editable.
4
+ */
5
+#ifndef CONDITIONALS_H
6
+
7
+#ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
8
+
9
+  #define CONFIGURATION_LCD
10
+
11
+  #if defined(MAKRPANEL)
12
+    #define DOGLCD
13
+    #define SDSUPPORT
14
+    #define DEFAULT_LCD_CONTRAST 17
15
+    #define ULTIPANEL
16
+    #define NEWPANEL
17
+  #endif
18
+
19
+  #if defined(miniVIKI) || defined(VIKI2)
20
+    #define ULTRA_LCD  //general LCD support, also 16x2
21
+    #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
22
+    #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
23
+
24
+    #ifdef miniVIKI
25
+      #define DEFAULT_LCD_CONTRAST 95
26
+    #else
27
+      #define DEFAULT_LCD_CONTRAST 40
28
+    #endif
29
+
30
+    #define ENCODER_PULSES_PER_STEP 4
31
+    #define ENCODER_STEPS_PER_MENU_ITEM 1
32
+  #endif
33
+
34
+  #ifdef PANEL_ONE
35
+    #define SDSUPPORT
36
+    #define ULTIMAKERCONTROLLER
37
+  #endif
38
+
39
+  #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
40
+    #define DOGLCD
41
+    #define U8GLIB_ST7920
42
+    #define REPRAP_DISCOUNT_SMART_CONTROLLER
43
+  #endif
44
+
45
+  #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
46
+    #define ULTIPANEL
47
+    #define NEWPANEL
48
+  #endif
49
+
50
+  #ifdef REPRAPWORLD_KEYPAD
51
+    #define ULTIPANEL
52
+    #define NEWPANEL
53
+  #endif
54
+
55
+  #ifdef RA_CONTROL_PANEL
56
+    #define LCD_I2C_TYPE_PCA8574
57
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
58
+    #define ULTIPANEL
59
+    #define NEWPANEL
60
+  #endif
61
+
62
+  /**
63
+   * I2C PANELS
64
+   */
65
+
66
+  #ifdef LCD_I2C_SAINSMART_YWROBOT
67
+    // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
68
+    // Make sure it is placed in the Arduino libraries directory.
69
+    #define LCD_I2C_TYPE_PCF8575
70
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
71
+    #define ULTIPANEL
72
+    #define NEWPANEL
73
+  #endif
74
+
75
+  // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
76
+  #ifdef LCD_I2C_PANELOLU2
77
+    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
78
+    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
79
+    // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
80
+    // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
81
+    //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
82
+    #define LCD_I2C_TYPE_MCP23017
83
+    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
84
+    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
85
+
86
+    #ifndef ENCODER_PULSES_PER_STEP
87
+      #define ENCODER_PULSES_PER_STEP 4
88
+    #endif
89
+
90
+    #ifndef ENCODER_STEPS_PER_MENU_ITEM
91
+      #define ENCODER_STEPS_PER_MENU_ITEM 1
92
+    #endif
93
+
94
+    #ifdef LCD_USE_I2C_BUZZER
95
+      #define LCD_FEEDBACK_FREQUENCY_HZ 1000
96
+      #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
97
+    #endif
98
+
99
+    #define ULTIPANEL
100
+    #define NEWPANEL
101
+  #endif
102
+
103
+  // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
104
+  #ifdef LCD_I2C_VIKI
105
+    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
106
+    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
107
+    // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
108
+    //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
109
+    #define LCD_I2C_TYPE_MCP23017
110
+    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
111
+    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
112
+    #define ULTIPANEL
113
+    #define NEWPANEL
114
+  #endif
115
+
116
+  // Shift register panels
117
+  // ---------------------
118
+  // 2 wire Non-latching LCD SR from:
119
+  // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
120
+
121
+  #ifdef SAV_3DLCD
122
+     #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
123
+     #define ULTIPANEL
124
+     #define NEWPANEL
125
+  #endif
126
+
127
+
128
+  #ifdef ULTIPANEL
129
+    #define NEWPANEL  //enable this if you have a click-encoder panel
130
+    #define SDSUPPORT
131
+    #define ULTRA_LCD
132
+    #ifdef DOGLCD // Change number of lines to match the DOG graphic display
133
+      #define LCD_WIDTH 22
134
+      #define LCD_HEIGHT 5
135
+    #else
136
+      #define LCD_WIDTH 20
137
+      #define LCD_HEIGHT 4
138
+    #endif
139
+  #else //no panel but just LCD
140
+    #ifdef ULTRA_LCD
141
+    #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
142
+      #define LCD_WIDTH 22
143
+      #define LCD_HEIGHT 5
144
+    #else
145
+      #define LCD_WIDTH 16
146
+      #define LCD_HEIGHT 2
147
+    #endif
148
+    #endif
149
+  #endif
150
+
151
+  /**
152
+   * Default LCD contrast for dogm-like LCD displays
153
+   */
154
+  #if defined(DOGLCD) && !defined(DEFAULT_LCD_CONTRAST)
155
+    #define DEFAULT_LCD_CONTRAST 32
156
+  #endif
157
+
158
+#else // CONFIGURATION_LCD
159
+
160
+  #define CONDITIONALS_H
161
+
162
+  #ifndef AT90USB
163
+    #define HardwareSerial_h // trick to disable the standard HWserial
164
+  #endif
165
+
166
+  #if (ARDUINO >= 100)
167
+    #include "Arduino.h"
168
+  #else
169
+    #include "WProgram.h"
170
+  #endif
171
+
172
+  #include "pins.h"
173
+
174
+  /**
175
+   * ENDSTOPPULLUPS
176
+   */
177
+  #ifdef ENDSTOPPULLUPS
178
+    #ifndef DISABLE_MAX_ENDSTOPS
179
+      #define ENDSTOPPULLUP_XMAX
180
+      #define ENDSTOPPULLUP_YMAX
181
+      #define ENDSTOPPULLUP_ZMAX
182
+    #endif
183
+    #ifndef DISABLE_MIN_ENDSTOPS
184
+      #define ENDSTOPPULLUP_XMIN
185
+      #define ENDSTOPPULLUP_YMIN
186
+      #define ENDSTOPPULLUP_ZMIN
187
+    #endif
188
+  #endif
189
+
190
+  /**
191
+   * Axis lengths
192
+   */
193
+  #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
194
+  #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
195
+  #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
196
+
197
+  /**
198
+   * SCARA
199
+   */
200
+  #ifdef SCARA
201
+    #undef SLOWDOWN
202
+    #define QUICK_HOME //SCARA needs Quickhome
203
+  #endif
204
+
205
+  /**
206
+   * AUTOSET LOCATIONS OF LIMIT SWITCHES
207
+   * Added by ZetaPhoenix 09-15-2012
208
+   */
209
+  #ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
210
+    #define X_HOME_POS MANUAL_X_HOME_POS
211
+    #define Y_HOME_POS MANUAL_Y_HOME_POS
212
+    #define Z_HOME_POS MANUAL_Z_HOME_POS
213
+  #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
214
+    #ifdef BED_CENTER_AT_0_0
215
+      #define X_HOME_POS X_MAX_LENGTH * X_HOME_DIR * 0.5
216
+      #define Y_HOME_POS Y_MAX_LENGTH * Y_HOME_DIR * 0.5
217
+    #else
218
+      #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
219
+      #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
220
+    #endif
221
+    #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
222
+  #endif //!MANUAL_HOME_POSITIONS
223
+
224
+  /**
225
+   * Auto Bed Leveling
226
+   */
227
+  #ifdef ENABLE_AUTO_BED_LEVELING
228
+    // Boundaries for probing based on set limits
229
+    #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
230
+    #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
231
+    #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
232
+    #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
233
+  #endif
234
+
235
+  /**
236
+   * MAX_STEP_FREQUENCY differs for TOSHIBA
237
+   */
238
+  #ifdef CONFIG_STEPPERS_TOSHIBA
239
+    #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
240
+  #else
241
+    #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
242
+  #endif
243
+
244
+  // MS1 MS2 Stepper Driver Microstepping mode table
245
+  #define MICROSTEP1 LOW,LOW
246
+  #define MICROSTEP2 HIGH,LOW
247
+  #define MICROSTEP4 LOW,HIGH
248
+  #define MICROSTEP8 HIGH,HIGH
249
+  #define MICROSTEP16 HIGH,HIGH
250
+
251
+  /**
252
+   * Advance calculated values
253
+   */
254
+  #ifdef ADVANCE
255
+    #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
256
+    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA)
257
+  #endif
258
+
259
+  #ifdef ULTIPANEL
260
+   #undef SDCARDDETECTINVERTED
261
+  #endif
262
+
263
+  // Power Signal Control Definitions
264
+  // By default use ATX definition
265
+  #ifndef POWER_SUPPLY
266
+    #define POWER_SUPPLY 1
267
+  #endif
268
+  // 1 = ATX
269
+  #if (POWER_SUPPLY == 1)
270
+    #define PS_ON_AWAKE  LOW
271
+    #define PS_ON_ASLEEP HIGH
272
+  #endif
273
+  // 2 = X-Box 360 203W
274
+  #if (POWER_SUPPLY == 2)
275
+    #define PS_ON_AWAKE  HIGH
276
+    #define PS_ON_ASLEEP LOW
277
+  #endif
278
+
279
+  /**
280
+   * Temp Sensor defines
281
+   */
282
+  #if TEMP_SENSOR_0 == -2
283
+    #define HEATER_0_USES_MAX6675
284
+  #elif TEMP_SENSOR_0 == -1
285
+    #define HEATER_0_USES_AD595
286
+  #elif TEMP_SENSOR_0 == 0
287
+    #undef HEATER_0_MINTEMP
288
+    #undef HEATER_0_MAXTEMP
289
+  #elif TEMP_SENSOR_0 > 0
290
+    #define THERMISTORHEATER_0 TEMP_SENSOR_0
291
+    #define HEATER_0_USES_THERMISTOR
292
+  #endif
293
+
294
+  #if TEMP_SENSOR_1 == -1
295
+    #define HEATER_1_USES_AD595
296
+  #elif TEMP_SENSOR_1 == 0
297
+    #undef HEATER_1_MINTEMP
298
+    #undef HEATER_1_MAXTEMP
299
+  #elif TEMP_SENSOR_1 > 0
300
+    #define THERMISTORHEATER_1 TEMP_SENSOR_1
301
+    #define HEATER_1_USES_THERMISTOR
302
+  #endif
303
+
304
+  #if TEMP_SENSOR_2 == -1
305
+    #define HEATER_2_USES_AD595
306
+  #elif TEMP_SENSOR_2 == 0
307
+    #undef HEATER_2_MINTEMP
308
+    #undef HEATER_2_MAXTEMP
309
+  #elif TEMP_SENSOR_2 > 0
310
+    #define THERMISTORHEATER_2 TEMP_SENSOR_2
311
+    #define HEATER_2_USES_THERMISTOR
312
+  #endif
313
+
314
+  #if TEMP_SENSOR_3 == -1
315
+    #define HEATER_3_USES_AD595
316
+  #elif TEMP_SENSOR_3 == 0
317
+    #undef HEATER_3_MINTEMP
318
+    #undef HEATER_3_MAXTEMP
319
+  #elif TEMP_SENSOR_3 > 0
320
+    #define THERMISTORHEATER_3 TEMP_SENSOR_3
321
+    #define HEATER_3_USES_THERMISTOR
322
+  #endif
323
+
324
+  #if TEMP_SENSOR_BED == -1
325
+    #define BED_USES_AD595
326
+  #elif TEMP_SENSOR_BED == 0
327
+    #undef BED_MINTEMP
328
+    #undef BED_MAXTEMP
329
+  #elif TEMP_SENSOR_BED > 0
330
+    #define THERMISTORBED TEMP_SENSOR_BED
331
+    #define BED_USES_THERMISTOR
332
+  #endif
333
+
334
+  /**
335
+   * ARRAY_BY_EXTRUDERS based on EXTRUDERS
336
+   */
337
+  #if EXTRUDERS > 3
338
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3, v4 }
339
+  #elif EXTRUDERS > 2
340
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3 }
341
+  #elif EXTRUDERS > 1
342
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2 }
343
+  #else
344
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1 }
345
+  #endif
346
+
347
+  /**
348
+   * Shorthand for pin tests, for temperature.cpp
349
+   */
350
+  #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0)
351
+  #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0)
352
+  #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0)
353
+  #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0)
354
+  #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0)
355
+  #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
356
+  #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0)
357
+  #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0)
358
+  #define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0)
359
+  #define HAS_HEATER_3 (defined(HEATER_3_PIN) && HEATER_3_PIN >= 0)
360
+  #define HAS_HEATER_BED (defined(HEATER_BED_PIN) && HEATER_BED_PIN >= 0)
361
+  #define HAS_AUTO_FAN_0 (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN >= 0)
362
+  #define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0)
363
+  #define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0)
364
+  #define HAS_AUTO_FAN_3 (defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN >= 0)
365
+  #define HAS_AUTO_FAN HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3
366
+  #define HAS_FAN (defined(FAN_PIN) && FAN_PIN >= 0)
367
+
368
+  /**
369
+   * Helper Macros for heaters and extruder fan
370
+   */
371
+  #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
372
+  #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
373
+    #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
374
+    #if EXTRUDERS > 2
375
+      #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
376
+      #if EXTRUDERS > 3
377
+        #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
378
+      #endif
379
+    #endif
380
+  #endif
381
+  #ifdef HEATERS_PARALLEL
382
+    #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
383
+  #else
384
+    #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
385
+  #endif
386
+  #if HAS_HEATER_BED
387
+    #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
388
+  #endif
389
+  #if HAS_FAN
390
+    #define WRITE_FAN(v) WRITE(FAN_PIN, v)
391
+  #endif
392
+
393
+  /**
394
+   * Sampling period of the temperature routine
395
+   * This override comes originally from temperature.cpp
396
+   * The Configuration.h option is basically ignored.
397
+   */
398
+  #ifdef PID_dT
399
+    #undef PID_dT
400
+  #endif
401
+  #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0))
402
+
403
+
404
+#endif //CONFIGURATION_LCD
405
+#endif //CONDITIONALS_H

Loading…
Откажи
Сачувај