Ver código fonte

Catch more LPC1768 pin conflicts (#17019)

Scott Lahteine 4 anos atrás
pai
commit
730804289c
Nenhuma conta vinculada ao e-mail do autor do commit

+ 149
- 21
Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h Ver arquivo

@@ -88,40 +88,168 @@
88 88
  * Serial3 | P0_00 | P0_01 |
89 89
  */
90 90
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 0)
91
-  #if  X_CS_PIN == P0_02 || TMC_SW_MISO == P0_02 || (E_STEPPERS && E_MUX1_PIN == P0_02) \
92
-    || Y_CS_PIN == P0_03 || TMC_SW_MOSI == P0_03 || (E_STEPPERS && E_MUX0_PIN == P0_03)
93
-    #error "Serial port assignment (0) conflicts with other pins!"
91
+  #define IS_TX0(P) (P == P0_02)
92
+  #define IS_RX0(P) (P == P0_03)
93
+  #if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI)
94
+    #error "Serial port pins (0) conflict with Trinamic SPI pins!"
95
+  #elif ENABLED(MK2_MULTIPLEXER) && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN))
96
+    #error "Serial port pins (0) conflict with MK2 multiplexer pins!"
97
+  #elif (AXIS_HAS_SPI(X) && IS_TX0(X_CS_PIN)) || (AXIS_HAS_SPI(Y) && IS_RX0(Y_CS_PIN))
98
+    #error "Serial port pins (0) conflict with X/Y axis SPI pins!"
94 99
   #endif
100
+  #undef IS_TX0
101
+  #undef IS_RX0
95 102
 #endif
96 103
 
97 104
 #if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || DGUS_SERIAL_PORT == 1
98
-  #if TMC_SW_SCK == P0_15
99
-    #error "Serial port assignment (1) conflicts with other pins!"
105
+  #define IS_TX1(P) (P == P0_15)
106
+  #define IS_RX1(P) (P == P0_16)
107
+  #if IS_TX1(TMC_SW_SCK)
108
+    #error "Serial port pins (1) conflict with other pins!"
100 109
   #elif HAS_SPI_LCD
101
-    #if  BTN_EN2 == P0_15 || SCK_PIN == P0_15 || LCD_PINS_D4 == P0_15 || DOGLCD_SCK == P0_15 || LCD_RESET_PIN == P0_15 || LCD_PINS_RS == P0_15 || SHIFT_CLK == P0_15 \
102
-      || BTN_EN1 == P0_16 || LCD_SDSS == P0_16 || LCD_PINS_RS == P0_16 || MISO_PIN == P0_16 || DOGLCD_A0 == P0_16 || SS_PIN == P0_16 || LCD_SDSS == P0_16 || DOGLCD_CS == P0_16 || LCD_RESET_PIN == P0_16 || LCD_BACKLIGHT_PIN == P0_16
103
-      #error "Serial port assignment (1) conflicts with other pins!"
110
+    #if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1)
111
+      #error "Serial port pins (1) conflict with Encoder Buttons!"
112
+    #elif IS_TX1(SCK_PIN) || IS_TX1(LCD_PINS_D4) || IS_TX1(DOGLCD_SCK) || IS_TX1(LCD_RESET_PIN) || IS_TX1(LCD_PINS_RS) || IS_TX1(SHIFT_CLK) \
113
+      || IS_RX1(LCD_SDSS) || IS_RX1(LCD_PINS_RS) || IS_RX1(MISO_PIN) || IS_RX1(DOGLCD_A0) || IS_RX1(SS_PIN) || IS_RX1(LCD_SDSS) || IS_RX1(DOGLCD_CS) || IS_RX1(LCD_RESET_PIN) || IS_RX1(LCD_BACKLIGHT_PIN)
114
+      #error "Serial port pins (1) conflict with LCD pins!"
104 115
     #endif
105 116
   #endif
117
+  #undef IS_TX1
118
+  #undef IS_RX1
106 119
 #endif
107 120
 
108 121
 #if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 || DGUS_SERIAL_PORT == 2
109
-  #if  Y_MIN_PIN == P0_10 || Z_MIN_PROBE_PIN == P0_10 \
110
-    || X_ENABLE_PIN == P0_10 || Y_ENABLE_PIN == P0_10 || X2_ENABLE_PIN == P0_10 || Y2_ENABLE_PIN == P0_10 || Z2_ENABLE_PIN == P0_10 || Z3_ENABLE_PIN == P0_10 || Z4_ENABLE_PIN == P0_10 \
111
-    || X2_CS_PIN == P0_10 || Y2_CS_PIN == P0_10 || Z2_CS_PIN == P0_10 || Z3_CS_PIN == P0_10 || Z4_CS_PIN == P0_10 \
112
-    || X_DIR_PIN == P0_11 || Y_DIR_PIN == P0_11 || X2_DIR_PIN == P0_11 || Y2_DIR_PIN == P0_11 || Z2_DIR_PIN == P0_11 || Z3_DIR_PIN == P0_11 || Z4_DIR_PIN == P0_11 \
113
-    || X2_STEP_PIN == P0_11 || Y2_STEP_PIN == P0_11 || Z2_STEP_PIN == P0_11 || Z3_STEP_PIN == P0_11 || Z4_STEP_PIN == P0_11
114
-    #error "Serial port assignment (2) conflicts with other pins!"
115
-  #elif  (E_STEPPERS > 1 && (E1_ENABLE_PIN == P0_10 || E1_CS_PIN == P0_10)) || (E_STEPPERS > 0 && (E0_DIR_PIN == P0_11 || E0_STEP_PIN == P0_11))
116
-    #error "Serial port assignment (2) conflicts with other pins!"
122
+  #define IS_TX2(P) (P == P0_10)
123
+  #define IS_RX2(P) (P == P0_11)
124
+  #if  IS_TX2(X2_ENABLE_PIN) || IS_RX2(X2_DIR_PIN) || IS_RX2(X2_STEP_PIN) || (AXIS_HAS_SPI(X2) && IS_TX2(X2_CS_PIN))
125
+    #error "Serial port pins (2) conflict with X2 pins!"
126
+  #elif IS_TX2(Y2_ENABLE_PIN) || IS_RX2(Y2_DIR_PIN) || IS_RX2(Y2_STEP_PIN) || (AXIS_HAS_SPI(Y2) && IS_TX2(Y2_CS_PIN))
127
+    #error "Serial port pins (2) conflict with Y2 pins!"
128
+  #elif IS_TX2(Z2_ENABLE_PIN) || IS_RX2(Z2_DIR_PIN) || IS_RX2(Z2_STEP_PIN) || (AXIS_HAS_SPI(Z2) && IS_TX2(Z2_CS_PIN))
129
+    #error "Serial port pins (2) conflict with Z2 pins!"
130
+  #elif IS_TX2(Z3_ENABLE_PIN) || IS_RX2(Z3_DIR_PIN) || IS_RX2(Z3_STEP_PIN) || (AXIS_HAS_SPI(Z3) && IS_TX2(Z3_CS_PIN))
131
+    #error "Serial port pins (2) conflict with Z3 pins!"
132
+  #elif IS_TX2(Z4_ENABLE_PIN) || IS_RX2(Z4_DIR_PIN) || IS_RX2(Z4_STEP_PIN) || (AXIS_HAS_SPI(Z4) && IS_TX2(Z4_CS_PIN))
133
+    #error "Serial port pins (2) conflict with Z4 pins!"
134
+  #elif IS_RX2(X_DIR_PIN) || IS_RX2(Y_DIR_PIN)
135
+    #error "Serial port pins (2) conflict with other pins!"
136
+  #elif Y_HOME_DIR < 0 && IS_TX2(Y_STOP_PIN)
137
+    #error "Serial port pins (2) conflict with Y endstop pin!"
138
+  #elif HAS_CUSTOM_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
139
+    #error "Serial port pins (2) conflict with probe pin!"
140
+  #elif IS_TX2(X_ENABLE_PIN) || IS_RX2(X_DIR_PIN) || IS_TX2(Y_ENABLE_PIN) || IS_RX2(Y_DIR_PIN)
141
+    #error "Serial port pins (2) conflict with X/Y stepper pins!"
142
+  #elif EXTRUDERS > 1 && (IS_TX2(E1_ENABLE_PIN) || (AXIS_HAS_SPI(E1) && IS_TX2(E1_CS_PIN)))
143
+    #error "Serial port pins (2) conflict with E1 stepper pins!"
144
+  #elif EXTRUDERS && (IS_RX2(E0_DIR_PIN) || IS_RX2(E0_STEP_PIN))
145
+    #error "Serial port pins (2) conflict with E stepper pins!"
117 146
   #endif
147
+  #undef IS_TX2
148
+  #undef IS_RX2
118 149
 #endif
119 150
 
120 151
 #if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 || DGUS_SERIAL_PORT == 3
121
-  #if  X_MIN_PIN == P0_00 || Y_SERIAL_TX_PIN == P0_00 || Y_SERIAL_RX_PIN == P0_00 \
122
-    || X_MAX_PIN == P0_01 || X_SERIAL_TX_PIN == P0_01 || X_SERIAL_RX_PIN == P0_01
123
-    #error "Serial port assignment (2) conflicts with other pins!"
124
-  #elif E_STEPPERS > 1 && (E1_DIR_PIN == P0_00 || E1_STEP_PIN == P0_01)
125
-    #error "Serial port assignment (2) conflicts with other pins!"
152
+  #define PIN_IS_TX3(P) (PIN_EXISTS(P) && P##_PIN == P0_00)
153
+  #define PIN_IS_RX3(P) (P##_PIN == P0_01)
154
+  #if PIN_IS_TX3(X_MIN) || PIN_IS_RX3(X_MAX)
155
+    #error "Serial port pins (3) conflict with X endstop pins!"
156
+  #elif PIN_IS_TX3(Y_SERIAL_TX) || PIN_IS_TX3(Y_SERIAL_RX) \
157
+    ||  PIN_IS_RX3(X_SERIAL_TX) || PIN_IS_RX3(X_SERIAL_RX)
158
+    #error "Serial port pins (3) conflict with X/Y axis UART pins!"
159
+  #elif PIN_IS_TX3(X2_DIR) || PIN_IS_RX3(X2_STEP)
160
+    #error "Serial port pins (3) conflict with X2 pins!"
161
+  #elif PIN_IS_TX3(Y2_DIR) || PIN_IS_RX3(Y2_STEP)
162
+    #error "Serial port pins (3) conflict with Y2 pins!"
163
+  #elif PIN_IS_TX3(Z2_DIR) || PIN_IS_RX3(Z2_STEP)
164
+    #error "Serial port pins (3) conflict with Z2 pins!"
165
+  #elif PIN_IS_TX3(Z3_DIR) || PIN_IS_RX3(Z3_STEP)
166
+    #error "Serial port pins (3) conflict with Z3 pins!"
167
+  #elif PIN_IS_TX3(Z4_DIR) || PIN_IS_RX3(Z4_STEP)
168
+    #error "Serial port pins (3) conflict with Z4 pins!"
169
+  #elif EXTRUDERS > 1 && (PIN_IS_TX3(E1_DIR) || PIN_IS_RX3(E1_STEP))
170
+    #error "Serial port pins (3) conflict with E1 pins!"
126 171
   #endif
172
+  #undef PIN_IS_TX3
173
+  #undef PIN_IS_RX3
174
+#endif
175
+
176
+//
177
+// Flag any i2c pin conflicts
178
+//
179
+#if ANY(DIGIPOT_I2C, DIGIPOT_MCP4018, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, NEOPIXEL_LED, PCA9632, I2C_EEPROM)
180
+  #define USEDI2CDEV_M 1  // <Arduino>/Wire.cpp
181
+
182
+  #if USEDI2CDEV_M == 0         // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1)
183
+    #define PIN_IS_SDA0(P) (P##_PIN == P0_27)
184
+    #define IS_SCL0(P)     (P == P0_28)
185
+    #if ENABLED(SDSUPPORT) && PIN_IS_SDA0(SD_DETECT)
186
+      #error "SDA0 overlaps with SD_DETECT_PIN!"
187
+    #elif PIN_IS_SDA0(E0_AUTO_FAN)
188
+      #error "SDA0 overlaps with E0_AUTO_FAN_PIN!"
189
+    #elif PIN_IS_SDA0(BEEPER)
190
+      #error "SDA0 overlaps with BEEPER_PIN!"
191
+    #elif IS_SCL0(BTN_ENC)
192
+      #error "SCL0 overlaps with Encoder Button!"
193
+    #elif IS_SCL0(SS_PIN)
194
+      #error "SCL0 overlaps with SS_PIN!"
195
+    #elif IS_SCL0(LCD_SDSS)
196
+      #error "SCL0 overlaps with LCD_SDSS!"
197
+    #endif
198
+    #undef PIN_IS_SDA0
199
+    #undef IS_SCL0
200
+  #elif USEDI2CDEV_M == 1       // P0_00 [D20] (SCA) ............ P0_01 [D21] (SCL)
201
+    #define PIN_IS_SDA1(P) (PIN_EXISTS(P) && P##_PIN == P0_00)
202
+    #define PIN_IS_SCL1(P) (P##_PIN == P0_01)
203
+    #if PIN_IS_SDA1(X_MIN) || PIN_IS_SCL1(X_MAX)
204
+      #error "One or more i2c (1) pins overlaps with X endstop pins! Disable i2c peripherals."
205
+    #elif PIN_IS_SDA1(X2_DIR) || PIN_IS_SCL1(X2_STEP)
206
+      #error "One or more i2c (1) pins overlaps with X2 pins! Disable i2c peripherals."
207
+    #elif PIN_IS_SDA1(Y2_DIR) || PIN_IS_SCL1(Y2_STEP)
208
+      #error "One or more i2c (1) pins overlaps with Y2 pins! Disable i2c peripherals."
209
+    #elif PIN_IS_SDA1(Z2_DIR) || PIN_IS_SCL1(Z2_STEP)
210
+      #error "One or more i2c (1) pins overlaps with Z2 pins! Disable i2c peripherals."
211
+    #elif PIN_IS_SDA1(Z3_DIR) || PIN_IS_SCL1(Z3_STEP)
212
+      #error "One or more i2c (1) pins overlaps with Z3 pins! Disable i2c peripherals."
213
+    #elif PIN_IS_SDA1(Z4_DIR) || PIN_IS_SCL1(Z4_STEP)
214
+      #error "One or more i2c (1) pins overlaps with Z4 pins! Disable i2c peripherals."
215
+    #elif EXTRUDERS > 1 && (PIN_IS_SDA1(E1_DIR) || PIN_IS_SCL1(E1_STEP))
216
+      #error "One or more i2c (1) pins overlaps with E1 pins! Disable i2c peripherals."
217
+    #endif
218
+    #undef PIN_IS_SDA1
219
+    #undef PIN_IS_SCL1
220
+  #elif USEDI2CDEV_M == 2     // P0_10 [D38] (X_ENABLE_PIN) ... P0_11 [D55] (X_DIR_PIN)
221
+    #define PIN_IS_SDA2(P) (P##_PIN == P0_10)
222
+    #define PIN_IS_SCL2(P) (P##_PIN == P0_11)
223
+    #if PIN_IS_SDA2(Y_STOP)
224
+      #error "i2c SDA2 overlaps with Y endstop pin!"
225
+    #elif HAS_CUSTOM_PROBE_PIN && PIN_IS_SDA2(Z_MIN_PROBE)
226
+      #error "i2c SDA2 overlaps with Z probe pin!"
227
+    #elif PIN_IS_SDA2(X_ENABLE) || PIN_IS_SDA2(Y_ENABLE)
228
+      #error "i2c SDA2 overlaps with X/Y ENABLE pin!"
229
+    #elif AXIS_HAS_SPI(X) && PIN_IS_SDA2(X_CS)
230
+      #error "i2c SDA2 overlaps with X CS pin!"
231
+    #elif PIN_IS_SDA2(X2_ENABLE)
232
+      #error "i2c SDA2 overlaps with X2 enable pin! Disable i2c peripherals."
233
+    #elif PIN_IS_SDA2(Y2_ENABLE)
234
+      #error "i2c SDA2 overlaps with Y2 enable pin! Disable i2c peripherals."
235
+    #elif PIN_IS_SDA2(Z2_ENABLE)
236
+      #error "i2c SDA2 overlaps with Z2 enable pin! Disable i2c peripherals."
237
+    #elif PIN_IS_SDA2(Z3_ENABLE)
238
+      #error "i2c SDA2 overlaps with Z3 enable pin! Disable i2c peripherals."
239
+    #elif PIN_IS_SDA2(Z4_ENABLE)
240
+      #error "i2c SDA2 overlaps with Z4 enable pin! Disable i2c peripherals."
241
+    #elif EXTRUDERS > 1 && PIN_IS_SDA2(E1_ENABLE)
242
+      #error "i2c SDA2 overlaps with E1 enable pin! Disable i2c peripherals."
243
+    #elif EXTRUDERS > 1 && AXIS_HAS_SPI(E1) && PIN_IS_SDA2(E1_CS)
244
+      #error "i2c SDA2 overlaps with E1 CS pin! Disable i2c peripherals."
245
+    #elif EXTRUDERS && (PIN_IS_SDA2(E0_STEP) || PIN_IS_SDA2(E0_DIR))
246
+      #error "i2c SCL2 overlaps with E0 STEP/DIR pin! Disable i2c peripherals."
247
+    #elif PIN_IS_SDA2(X_DIR) || PIN_IS_SDA2(Y_DIR)
248
+      #error "One or more i2c pins overlaps with X/Y DIR pin! Disable i2c peripherals."
249
+    #endif
250
+    #undef PIN_IS_SDA2
251
+    #undef PIN_IS_SCL2
252
+  #endif
253
+
254
+  #undef USEDI2CDEV_M
127 255
 #endif

+ 38
- 4
Marlin/src/inc/Conditionals_LCD.h Ver arquivo

@@ -433,23 +433,42 @@
433 433
 #ifndef HOTENDS
434 434
   #define HOTENDS EXTRUDERS
435 435
 #endif
436
-
437 436
 #ifndef E_STEPPERS
438 437
   #define E_STEPPERS EXTRUDERS
439 438
 #endif
440
-
441 439
 #ifndef E_MANUAL
442 440
   #define E_MANUAL EXTRUDERS
443 441
 #endif
444 442
 
443
+// Helper macros for extruder and hotend arrays
445 444
 #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
445
+#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
446
+#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1)
447
+#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
448
+#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
446 449
 
447 450
 #define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR))
448 451
 #define SWITCHING_NOZZLE_TWO_SERVOS defined(SWITCHING_NOZZLE_E1_SERVO_NR)
449 452
 
450
-#define HAS_HOTEND_OFFSET (HOTENDS > 1)
451 453
 #define HAS_DUPLICATION_MODE EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
452 454
 
455
+#define HAS_HOTEND_OFFSET (HOTENDS > 1)
456
+
457
+/**
458
+ * Default hotend offsets, if not defined
459
+ */
460
+#if HAS_HOTEND_OFFSET
461
+  #ifndef HOTEND_OFFSET_X
462
+    #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
463
+  #endif
464
+  #ifndef HOTEND_OFFSET_Y
465
+    #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
466
+  #endif
467
+  #ifndef HOTEND_OFFSET_Z
468
+    #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
469
+  #endif
470
+#endif
471
+
453 472
 /**
454 473
  * DISTINCT_E_FACTORS affects how some E factors are accessed
455 474
  */
@@ -575,8 +594,23 @@
575 594
 
576 595
 #define IS_RE_ARM_BOARD MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF)
577 596
 
578
-#define HAS_LINEAR_E_JERK (DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE))
597
+// Linear advance uses Jerk since E is an isolated axis
598
+#define HAS_LINEAR_E_JERK  (DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE))
599
+
600
+// This flag indicates some kind of jerk storage is needed
601
+#define HAS_CLASSIC_JERK   (ENABLED(CLASSIC_JERK) || IS_KINEMATIC)
602
+
603
+// E jerk exists with JD disabled (of course) but also when Linear Advance is disabled on Delta/SCARA
604
+#define HAS_CLASSIC_E_JERK (ENABLED(CLASSIC_JERK) || (IS_KINEMATIC && DISABLED(LIN_ADVANCE)))
579 605
 
580 606
 #ifndef SPI_SPEED
581 607
   #define SPI_SPEED SPI_FULL_SPEED
582 608
 #endif
609
+
610
+/**
611
+ * This setting is also used by M109 when trying to calculate
612
+ * a ballpark safe margin to prevent wait-forever situation.
613
+ */
614
+#ifndef EXTRUDE_MINTEMP
615
+  #define EXTRUDE_MINTEMP 170
616
+#endif

+ 101
- 6
Marlin/src/inc/Conditionals_adv.h Ver arquivo

@@ -56,11 +56,22 @@
56 56
   #undef SHOW_TEMP_ADC_VALUES
57 57
 #endif
58 58
 
59
+#if !NUM_SERIAL
60
+  #undef BAUD_RATE_GCODE
61
+#endif
62
+
59 63
 // Multiple Z steppers
60 64
 #ifndef NUM_Z_STEPPER_DRIVERS
61 65
   #define NUM_Z_STEPPER_DRIVERS 1
62 66
 #endif
63 67
 
68
+#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
69
+  #undef Z_STEPPER_ALIGN_AMP
70
+#endif
71
+#ifndef Z_STEPPER_ALIGN_AMP
72
+  #define Z_STEPPER_ALIGN_AMP 1.0
73
+#endif
74
+
64 75
 #define HAS_CUTTER EITHER(SPINDLE_FEATURE, LASER_FEATURE)
65 76
 
66 77
 #if !defined(__AVR__) || !defined(USBCON)
@@ -121,9 +132,6 @@
121 132
   #define LED_CONTROL_MENU
122 133
   #define LED_USER_PRESET_STARTUP
123 134
   #define LED_COLOR_PRESETS
124
-  #ifndef LED_USER_PRESET_RED
125
-    #define LED_USER_PRESET_RED        255
126
-  #endif
127 135
   #ifndef LED_USER_PRESET_GREEN
128 136
     #define LED_USER_PRESET_GREEN      128
129 137
   #endif
@@ -135,6 +143,32 @@
135 143
   #endif
136 144
 #endif
137 145
 
146
+// Set defaults for unspecified LED user colors
147
+#if ENABLED(LED_CONTROL_MENU)
148
+  #ifndef LED_USER_PRESET_RED
149
+    #define LED_USER_PRESET_RED       255
150
+  #endif
151
+  #ifndef LED_USER_PRESET_GREEN
152
+    #define LED_USER_PRESET_GREEN     255
153
+  #endif
154
+  #ifndef LED_USER_PRESET_BLUE
155
+    #define LED_USER_PRESET_BLUE      255
156
+  #endif
157
+  #ifndef LED_USER_PRESET_WHITE
158
+    #define LED_USER_PRESET_WHITE     0
159
+  #endif
160
+  #ifndef LED_USER_PRESET_BRIGHTNESS
161
+    #ifdef NEOPIXEL_BRIGHTNESS
162
+      #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
163
+    #else
164
+      #define LED_USER_PRESET_BRIGHTNESS 255
165
+    #endif
166
+  #endif
167
+#endif
168
+
169
+// If platform requires early initialization of watchdog to properly boot
170
+#define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM))
171
+
138 172
 // Extensible UI pin mapping for RepRapDiscount
139 173
 #define TOUCH_UI_ULTIPANEL ENABLED(TOUCH_UI_FTDI_EVE) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP)
140 174
 
@@ -143,7 +177,68 @@
143 177
   #define POLL_JOG
144 178
 #endif
145 179
 
146
-// G60/G61 Position Save
147
-#if SAVED_POSITIONS > 256
148
-  #error "SAVED_POSITIONS must be an integer from 0 to 256."
180
+/**
181
+ * Driver Timings
182
+ * NOTE: Driver timing order is longest-to-shortest duration.
183
+ *       Preserve this ordering when adding new drivers.
184
+ */
185
+
186
+#ifndef MINIMUM_STEPPER_POST_DIR_DELAY
187
+  #if HAS_DRIVER(TB6560)
188
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 15000
189
+  #elif HAS_DRIVER(TB6600)
190
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 1500
191
+  #elif HAS_DRIVER(DRV8825)
192
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 650
193
+  #elif HAS_DRIVER(LV8729)
194
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 500
195
+  #elif HAS_DRIVER(A5984)
196
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 400
197
+  #elif HAS_DRIVER(A4988)
198
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 200
199
+  #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE
200
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 20
201
+  #else
202
+    #define MINIMUM_STEPPER_POST_DIR_DELAY 0   // Expect at least 10µS since one Stepper ISR must transpire
203
+  #endif
204
+#endif
205
+
206
+#ifndef MINIMUM_STEPPER_PRE_DIR_DELAY
207
+  #define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY
208
+#endif
209
+
210
+#ifndef MINIMUM_STEPPER_PULSE
211
+  #if HAS_DRIVER(TB6560)
212
+    #define MINIMUM_STEPPER_PULSE 30
213
+  #elif HAS_DRIVER(TB6600)
214
+    #define MINIMUM_STEPPER_PULSE 3
215
+  #elif HAS_DRIVER(DRV8825)
216
+    #define MINIMUM_STEPPER_PULSE 2
217
+  #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
218
+    #define MINIMUM_STEPPER_PULSE 1
219
+  #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE
220
+    #define MINIMUM_STEPPER_PULSE 0
221
+  #elif HAS_DRIVER(LV8729)
222
+    #define MINIMUM_STEPPER_PULSE 0
223
+  #else
224
+    #define MINIMUM_STEPPER_PULSE 2
225
+  #endif
226
+#endif
227
+
228
+#ifndef MAXIMUM_STEPPER_RATE
229
+  #if HAS_DRIVER(TB6560)
230
+    #define MAXIMUM_STEPPER_RATE 15000
231
+  #elif HAS_DRIVER(TB6600)
232
+    #define MAXIMUM_STEPPER_RATE 150000
233
+  #elif HAS_DRIVER(DRV8825)
234
+    #define MAXIMUM_STEPPER_RATE 250000
235
+  #elif HAS_DRIVER(A4988)
236
+    #define MAXIMUM_STEPPER_RATE 500000
237
+  #elif HAS_DRIVER(LV8729)
238
+    #define MAXIMUM_STEPPER_RATE 1000000
239
+  #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE
240
+    #define MAXIMUM_STEPPER_RATE 5000000
241
+  #else
242
+    #define MAXIMUM_STEPPER_RATE 250000
243
+  #endif
149 244
 #endif

+ 3
- 149
Marlin/src/inc/Conditionals_post.h Ver arquivo

@@ -40,9 +40,6 @@
40 40
   #define NOT_A_PIN 0 // For PINS_DEBUGGING
41 41
 #endif
42 42
 
43
-#define HAS_CLASSIC_JERK (ENABLED(CLASSIC_JERK) || IS_KINEMATIC)
44
-#define HAS_CLASSIC_E_JERK (ENABLED(CLASSIC_JERK) || DISABLED(LIN_ADVANCE))
45
-
46 43
 /**
47 44
  * Axis lengths and center
48 45
  */
@@ -580,99 +577,6 @@
580 577
   HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR )
581 578
 
582 579
 /**
583
- * Default hotend offsets, if not defined
584
- */
585
-#if HAS_HOTEND_OFFSET
586
-  #ifndef HOTEND_OFFSET_X
587
-    #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
588
-  #endif
589
-  #ifndef HOTEND_OFFSET_Y
590
-    #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
591
-  #endif
592
-  #ifndef HOTEND_OFFSET_Z
593
-    #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
594
-  #endif
595
-#endif
596
-
597
-/**
598
- * ARRAY_BY_EXTRUDERS based on EXTRUDERS
599
- */
600
-#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
601
-#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1)
602
-
603
-/**
604
- * ARRAY_BY_HOTENDS based on HOTENDS
605
- */
606
-#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
607
-#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
608
-
609
-/**
610
- * Driver Timings
611
- * NOTE: Driver timing order is longest-to-shortest duration.
612
- *       Preserve this ordering when adding new drivers.
613
- */
614
-
615
-#ifndef MINIMUM_STEPPER_POST_DIR_DELAY
616
-  #if HAS_DRIVER(TB6560)
617
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 15000
618
-  #elif HAS_DRIVER(TB6600)
619
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 1500
620
-  #elif HAS_DRIVER(DRV8825)
621
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 650
622
-  #elif HAS_DRIVER(LV8729)
623
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 500
624
-  #elif HAS_DRIVER(A5984)
625
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 400
626
-  #elif HAS_DRIVER(A4988)
627
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 200
628
-  #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE
629
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 20
630
-  #else
631
-    #define MINIMUM_STEPPER_POST_DIR_DELAY 0   // Expect at least 10µS since one Stepper ISR must transpire
632
-  #endif
633
-#endif
634
-
635
-#ifndef MINIMUM_STEPPER_PRE_DIR_DELAY
636
-  #define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY
637
-#endif
638
-
639
-#ifndef MINIMUM_STEPPER_PULSE
640
-  #if HAS_DRIVER(TB6560)
641
-    #define MINIMUM_STEPPER_PULSE 30
642
-  #elif HAS_DRIVER(TB6600)
643
-    #define MINIMUM_STEPPER_PULSE 3
644
-  #elif HAS_DRIVER(DRV8825)
645
-    #define MINIMUM_STEPPER_PULSE 2
646
-  #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
647
-    #define MINIMUM_STEPPER_PULSE 1
648
-  #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE
649
-    #define MINIMUM_STEPPER_PULSE 0
650
-  #elif HAS_DRIVER(LV8729)
651
-    #define MINIMUM_STEPPER_PULSE 0
652
-  #else
653
-    #define MINIMUM_STEPPER_PULSE 2
654
-  #endif
655
-#endif
656
-
657
-#ifndef MAXIMUM_STEPPER_RATE
658
-  #if HAS_DRIVER(TB6560)
659
-    #define MAXIMUM_STEPPER_RATE 15000
660
-  #elif HAS_DRIVER(TB6600)
661
-    #define MAXIMUM_STEPPER_RATE 150000
662
-  #elif HAS_DRIVER(DRV8825)
663
-    #define MAXIMUM_STEPPER_RATE 250000
664
-  #elif HAS_DRIVER(A4988)
665
-    #define MAXIMUM_STEPPER_RATE 500000
666
-  #elif HAS_DRIVER(LV8729)
667
-    #define MAXIMUM_STEPPER_RATE 1000000
668
-  #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE
669
-    #define MAXIMUM_STEPPER_RATE 5000000
670
-  #else
671
-    #define MAXIMUM_STEPPER_RATE 250000
672
-  #endif
673
-#endif
674
-
675
-/**
676 580
  * X_DUAL_ENDSTOPS endstop reassignment
677 581
  */
678 582
 #if ENABLED(X_DUAL_ENDSTOPS)
@@ -1522,6 +1426,7 @@
1522 1426
 #if !HAS_TEMP_SENSOR
1523 1427
   #undef AUTO_REPORT_TEMPERATURES
1524 1428
 #endif
1429
+#define HAS_AUTO_REPORTING EITHER(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS)
1525 1430
 
1526 1431
 #if !HAS_AUTO_CHAMBER_FAN || AUTO_CHAMBER_IS_E
1527 1432
   #undef AUTO_POWER_CHAMBER_FAN
@@ -1618,20 +1523,6 @@
1618 1523
 
1619 1524
 #endif // HAS_MICROSTEPS
1620 1525
 
1621
-#if !HAS_TEMP_SENSOR
1622
-  #undef AUTO_REPORT_TEMPERATURES
1623
-#endif
1624
-
1625
-#define HAS_AUTO_REPORTING EITHER(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS)
1626
-
1627
-/**
1628
- * This setting is also used by M109 when trying to calculate
1629
- * a ballpark safe margin to prevent wait-forever situation.
1630
- */
1631
-#ifndef EXTRUDE_MINTEMP
1632
-  #define EXTRUDE_MINTEMP 170
1633
-#endif
1634
-
1635 1526
 /**
1636 1527
  * Heater signal inversion defaults
1637 1528
  */
@@ -2121,29 +2012,6 @@
2121 2012
   #define MAX_VFAT_ENTRIES (2)
2122 2013
 #endif
2123 2014
 
2124
-// Set defaults for unspecified LED user colors
2125
-#if ENABLED(LED_CONTROL_MENU)
2126
-  #ifndef LED_USER_PRESET_RED
2127
-    #define LED_USER_PRESET_RED       255
2128
-  #endif
2129
-  #ifndef LED_USER_PRESET_GREEN
2130
-    #define LED_USER_PRESET_GREEN     255
2131
-  #endif
2132
-  #ifndef LED_USER_PRESET_BLUE
2133
-    #define LED_USER_PRESET_BLUE      255
2134
-  #endif
2135
-  #ifndef LED_USER_PRESET_WHITE
2136
-    #define LED_USER_PRESET_WHITE     0
2137
-  #endif
2138
-  #ifndef LED_USER_PRESET_BRIGHTNESS
2139
-    #ifdef NEOPIXEL_BRIGHTNESS
2140
-      #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
2141
-    #else
2142
-      #define LED_USER_PRESET_BRIGHTNESS 255
2143
-    #endif
2144
-  #endif
2145
-#endif
2146
-
2147 2015
 // Nozzle park for Delta
2148 2016
 #if BOTH(NOZZLE_PARK_FEATURE, DELTA)
2149 2017
   #undef NOZZLE_PARK_Z_FEEDRATE
@@ -2180,13 +2048,10 @@
2180 2048
 #endif
2181 2049
 
2182 2050
 // Defined here to catch the above defines
2183
-#if ENABLED(SDCARD_SORT_ALPHA)
2184
-  #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
2051
+#if ENABLED(SDCARD_SORT_ALPHA) && (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
2052
+  #define HAS_FOLDER_SORTING 1
2185 2053
 #endif
2186 2054
 
2187
-// If platform requires early initialization of watchdog to properly boot
2188
-#define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM))
2189
-
2190 2055
 #if HAS_SPI_LCD
2191 2056
   // Get LCD character width/height, which may be overridden by pins, configs, etc.
2192 2057
   #ifndef LCD_WIDTH
@@ -2223,14 +2088,3 @@
2223 2088
     #define INIT_SDCARD_ON_BOOT
2224 2089
   #endif
2225 2090
 #endif
2226
-
2227
-#if !NUM_SERIAL
2228
-  #undef BAUD_RATE_GCODE
2229
-#endif
2230
-
2231
-#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
2232
-  #undef Z_STEPPER_ALIGN_AMP
2233
-#endif
2234
-#ifndef Z_STEPPER_ALIGN_AMP
2235
-  #define Z_STEPPER_ALIGN_AMP 1.0
2236
-#endif

+ 5
- 0
Marlin/src/inc/SanityCheck.h Ver arquivo

@@ -2732,3 +2732,8 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2732 2732
 #if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
2733 2733
   #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
2734 2734
 #endif
2735
+
2736
+// G60/G61 Position Save
2737
+#if SAVED_POSITIONS > 256
2738
+  #error "SAVED_POSITIONS must be an integer from 0 to 256."
2739
+#endif

Carregando…
Cancelar
Salvar