Skip to content

Commit 99647fa

Browse files
committed
🎨 Less use of undef for RAMPS pins
1 parent ea3df94 commit 99647fa

11 files changed

+220
-239
lines changed

Marlin/src/pins/mega/pins_MEGATRONICS_3.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,19 @@
6767
#define X_DIR_PIN 57
6868
#define X_ENABLE_PIN 59
6969

70-
#define Y_STEP_PIN 5
71-
#define Y_DIR_PIN 17
72-
#define Y_ENABLE_PIN 4
70+
#if ENABLED(REPRAPWORLD_KEYPAD) && EXTRUDERS <= 2
71+
#define Y_ENABLE_PIN 23
72+
#define Y_STEP_PIN 22
73+
#define Y_DIR_PIN 60
74+
#else
75+
#define Y_STEP_PIN 5
76+
#define Y_DIR_PIN 17
77+
#define Y_ENABLE_PIN 4
78+
79+
#define E2_STEP_PIN 22
80+
#define E2_DIR_PIN 60
81+
#define E2_ENABLE_PIN 23
82+
#endif
7383

7484
#define Z_STEP_PIN 16
7585
#define Z_DIR_PIN 11
@@ -83,10 +93,6 @@
8393
#define E1_DIR_PIN 24
8494
#define E1_ENABLE_PIN 26
8595

86-
#define E2_STEP_PIN 22
87-
#define E2_DIR_PIN 60
88-
#define E2_ENABLE_PIN 23
89-
9096
//
9197
// Temperature Sensors
9298
//
@@ -181,15 +187,6 @@
181187
#elif EXTRUDERS <= 2
182188
// Hijack the last extruder so that we can get the PWM signal off the Y breakout
183189
// Move Y to the E2 plug. This makes dual Y steppers harder
184-
#undef Y_ENABLE_PIN // 4
185-
#undef Y_STEP_PIN // 5
186-
#undef Y_DIR_PIN // 17
187-
#undef E2_ENABLE_PIN // 23
188-
#undef E2_STEP_PIN // 22
189-
#undef E2_DIR_PIN // 60
190-
#define Y_ENABLE_PIN 23
191-
#define Y_STEP_PIN 22
192-
#define Y_DIR_PIN 60
193190
#define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM
194191
#define SPINDLE_LASER_ENA_PIN 17 // Pullup!
195192
#define SPINDLE_DIR_PIN 5

Marlin/src/pins/ramps/pins_3DRAG.h

Lines changed: 69 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,28 @@
3737
#define DEFAULT_SOURCE_CODE_URL "3dprint.elettronicain.it"
3838
#endif
3939

40+
//
41+
// Limit Switches
42+
//
43+
#define Z_STOP_PIN 18
44+
45+
//
46+
// Steppers
47+
//
48+
#if HAS_CUTTER
49+
#define Z_DIR_PIN 28
50+
#define Z_ENABLE_PIN 24
51+
#define Z_STEP_PIN 26
52+
#else
53+
#define Z_ENABLE_PIN 63
54+
#endif
55+
56+
#if HAS_CUTTER && !HAS_EXTRUDERS
57+
#define E0_DIR_PIN -1
58+
#define E0_ENABLE_PIN -1
59+
#define E0_STEP_PIN -1
60+
#endif
61+
4062
//
4163
// Heaters / Fans
4264
//
@@ -53,18 +75,54 @@
5375
#define CASE_LIGHT_PIN -1 // Hardware PWM but one is not available on expansion header
5476
#endif
5577

56-
#include "pins_RAMPS.h"
57-
58-
//
59-
// Limit Switches
60-
//
61-
#undef Z_MAX_PIN
78+
/**
79+
* M3/M4/M5 - Spindle/Laser Control
80+
*
81+
* If you want to control the speed of your spindle then you'll have
82+
* have to sacrifce the Extruder and pull some signals off the Z stepper
83+
* driver socket.
84+
*
85+
* The following assumes:
86+
* - the Z stepper driver socket is empty
87+
* - the extruder driver socket has a driver board plugged into it
88+
* - the Z stepper wires are attached the the extruder connector
89+
*
90+
* If you want to keep the extruder AND don't have a LCD display then
91+
* you can still control the power on/off and spindle direction.
92+
*
93+
* Where to get spindle signals
94+
*
95+
* stepper signal socket name socket name
96+
* -------
97+
* SPINDLE_LASER_ENA_PIN /ENABLE O| |O VMOT
98+
* MS1 O| |O GND
99+
* MS2 O| |O 2B
100+
* MS3 O| |O 2A
101+
* /RESET O| |O 1A
102+
* /SLEEP O| |O 1B
103+
* SPINDLE_LASER_PWM_PIN STEP O| |O VDD
104+
* SPINDLE_DIR_PIN DIR O| |O GND
105+
* -------
106+
*
107+
* Note: Socket names vary from vendor to vendor
108+
*/
109+
#if HAS_CUTTER
110+
#if !HAS_EXTRUDERS
111+
#define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM
112+
#define SPINDLE_LASER_ENA_PIN 62 // Pullup!
113+
#define SPINDLE_DIR_PIN 48
114+
#elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use
115+
#define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown!
116+
#define SPINDLE_DIR_PIN 17
117+
#if !NUM_SERVOS // Use servo connector if possible
118+
#define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM
119+
#elif HAS_FREE_AUX2_PINS
120+
#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
121+
#endif
122+
#endif
123+
#endif
62124

63-
//
64-
// Steppers
65-
//
66-
#undef Z_ENABLE_PIN
67-
#define Z_ENABLE_PIN 63
125+
#include "pins_RAMPS.h"
68126

69127
//
70128
// Heaters / Fans
@@ -113,58 +171,3 @@
113171
#define BOARD_ST7920_DELAY_2 188
114172
#define BOARD_ST7920_DELAY_3 0
115173
#endif
116-
117-
/**
118-
* M3/M4/M5 - Spindle/Laser Control
119-
*
120-
* If you want to control the speed of your spindle then you'll have
121-
* have to sacrifce the Extruder and pull some signals off the Z stepper
122-
* driver socket.
123-
*
124-
* The following assumes:
125-
* - the Z stepper driver socket is empty
126-
* - the extruder driver socket has a driver board plugged into it
127-
* - the Z stepper wires are attached the the extruder connector
128-
*
129-
* If you want to keep the extruder AND don't have a LCD display then
130-
* you can still control the power on/off and spindle direction.
131-
*
132-
* Where to get spindle signals
133-
*
134-
* stepper signal socket name socket name
135-
* -------
136-
* SPINDLE_LASER_ENA_PIN /ENABLE O| |O VMOT
137-
* MS1 O| |O GND
138-
* MS2 O| |O 2B
139-
* MS3 O| |O 2A
140-
* /RESET O| |O 1A
141-
* /SLEEP O| |O 1B
142-
* SPINDLE_LASER_PWM_PIN STEP O| |O VDD
143-
* SPINDLE_DIR_PIN DIR O| |O GND
144-
* -------
145-
*
146-
* Note: Socket names vary from vendor to vendor
147-
*/
148-
#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not good with 3DRAG
149-
#undef SPINDLE_LASER_ENA_PIN
150-
#undef SPINDLE_DIR_PIN
151-
152-
#if HAS_CUTTER
153-
#if !HAS_EXTRUDERS
154-
#undef E0_DIR_PIN
155-
#undef E0_ENABLE_PIN
156-
#undef E0_STEP_PIN
157-
#undef Z_DIR_PIN
158-
#undef Z_ENABLE_PIN
159-
#undef Z_STEP_PIN
160-
#define Z_DIR_PIN 28
161-
#define Z_ENABLE_PIN 24
162-
#define Z_STEP_PIN 26
163-
#define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM
164-
#define SPINDLE_LASER_ENA_PIN 62 // Pullup!
165-
#define SPINDLE_DIR_PIN 48
166-
#elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use
167-
#define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown!
168-
#define SPINDLE_DIR_PIN 17
169-
#endif
170-
#endif

Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h

Lines changed: 45 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,41 @@
3030

3131
#define BOARD_INFO_NAME "ZUM Mega 3D"
3232

33+
//
34+
// Limit Switches
35+
//
36+
#define X_MAX_PIN 79
37+
38+
// This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team
39+
// decided to ship the printer only with the probe and no additional Z-min
40+
// endstop and the instruction manual advises the user to connect the probe to
41+
// IND_S_5V the option Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN will not work.
42+
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
43+
#define Z_MIN_PIN 19 // IND_S_5V
44+
#define Z_MAX_PIN 18 // Z-MIN Label
45+
#endif
46+
47+
//
48+
// Z Probe (when not Z_MIN_PIN)
49+
//
50+
#ifndef Z_MIN_PROBE_PIN
51+
#define Z_MIN_PROBE_PIN 19 // IND_S_5V
52+
#endif
53+
54+
//
55+
// Steppers
56+
//
57+
#define Z_ENABLE_PIN 77
58+
59+
#define DIGIPOTSS_PIN 22
60+
#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 }
61+
62+
//
63+
// Temperature Sensors
64+
//
65+
#define TEMP_1_PIN 14 // Analog Input
66+
#define TEMP_BED_PIN 15 // Analog Input
67+
3368
//
3469
// Heaters / Fans
3570
//
@@ -61,72 +96,31 @@
6196
#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
6297
#define SPINDLE_DIR_PIN 42
6398

64-
//
65-
// Limit Switches
66-
//
67-
#define X_MAX_PIN 79 // 2
68-
69-
//
70-
// Import RAMPS 1.3 pins
71-
//
72-
#include "pins_RAMPS_13.h"
73-
74-
//
75-
// Z Probe (when not Z_MIN_PIN)
76-
//
77-
#undef Z_MIN_PROBE_PIN
78-
#define Z_MIN_PROBE_PIN 19 // IND_S_5V
79-
80-
#undef Z_ENABLE_PIN
81-
#define Z_ENABLE_PIN 77 // 62
82-
83-
//
84-
// Steppers
85-
//
86-
#define DIGIPOTSS_PIN 22
87-
#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 }
88-
89-
//
90-
// Temperature Sensors
91-
//
92-
#undef TEMP_1_PIN
93-
#define TEMP_1_PIN 14 // Analog Input (15)
94-
95-
#undef TEMP_BED_PIN
96-
#define TEMP_BED_PIN 15 // Analog Input (14)
97-
9899
//
99100
// Misc. Functions
100101
//
101-
#undef PS_ON_PIN // 12
102102
#define PS_ON_PIN 81 // External Power Supply
103103

104104
#ifndef CASE_LIGHT_PIN
105105
#define CASE_LIGHT_PIN 44 // Hardware PWM
106106
#endif
107107

108-
// This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team
109-
// decided to ship the printer only with the probe and no additional Z-min
110-
// endstop and the instruction manual advises the user to connect the probe to
111-
// IND_S_5V the option Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN will not work.
112-
#ifdef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
113-
#undef Z_MIN_PIN
114-
#undef Z_MAX_PIN
115-
#define Z_MIN_PIN 19 // IND_S_5V
116-
#define Z_MAX_PIN 18 // Z-MIN Label
108+
// Alter timing for graphical display
109+
#if ENABLED(U8GLIB_ST7920)
110+
#define BOARD_ST7920_DELAY_1 0
111+
#define BOARD_ST7920_DELAY_2 0
112+
#define BOARD_ST7920_DELAY_3 189
117113
#endif
118114

115+
//
116+
// Import RAMPS 1.3 pins
117+
//
118+
#include "pins_RAMPS_13.h"
119+
119120
//
120121
// Used by the Hephestos 2 heated bed upgrade kit
121122
//
122123
#if ENABLED(HEPHESTOS2_HEATED_BED_KIT)
123124
#undef HEATER_BED_PIN
124125
#define HEATER_BED_PIN 8
125126
#endif
126-
127-
// Alter timing for graphical display
128-
#if ENABLED(U8GLIB_ST7920)
129-
#define BOARD_ST7920_DELAY_1 0
130-
#define BOARD_ST7920_DELAY_2 0
131-
#define BOARD_ST7920_DELAY_3 189
132-
#endif

Marlin/src/pins/ramps/pins_K8400.h

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,22 @@
3535
#define BOARD_INFO_NAME "K8400"
3636
#define DEFAULT_MACHINE_NAME "Vertex"
3737

38-
#include "pins_3DRAG.h"
38+
//
39+
// Steppers
40+
//
41+
#if HAS_CUTTER
42+
#define Z_STEP_PIN 32
43+
#endif
44+
45+
#define E1_STEP_PIN 32
3946

4047
//
4148
// Limit Switches
4249
//
4350
#define X_STOP_PIN 3
4451
#define Y_STOP_PIN 14
4552

46-
#undef X_MIN_PIN
47-
#undef X_MAX_PIN
48-
#undef Y_MIN_PIN
49-
#undef Y_MAX_PIN
50-
51-
//
52-
// Steppers
53-
//
54-
#undef E1_STEP_PIN
55-
#define E1_STEP_PIN 32
53+
#include "pins_3DRAG.h"
5654

5755
//
5856
// Heaters / Fans
@@ -66,8 +64,3 @@
6664
#undef PS_ON_PIN
6765
#undef KILL_PIN
6866
#undef SD_DETECT_PIN
69-
70-
#if Z_STEP_PIN == 26
71-
#undef Z_STEP_PIN
72-
#define Z_STEP_PIN 32
73-
#endif

Marlin/src/pins/ramps/pins_K8600.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
#define Z_MAX_PIN 18
4141
#define Z_MIN_PIN -1
4242

43+
//
44+
// Steppers
45+
//
46+
#define Z_ENABLE_PIN 63
47+
4348
//
4449
// Heaters / Fans
4550
//
@@ -57,12 +62,6 @@
5762
#define IS_RAMPS_EFB // Override autodetection. Bed will be undefined.
5863
#include "pins_RAMPS.h"
5964

60-
//
61-
// Steppers
62-
//
63-
#undef Z_ENABLE_PIN
64-
#define Z_ENABLE_PIN 63
65-
6665
//
6766
// Heaters / Fans
6867
//

0 commit comments

Comments
 (0)