Skip to content

Commit

Permalink
🎨 Less use of undef for RAMPS pins
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 3, 2021
1 parent ea3df94 commit 99647fa
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 239 deletions.
29 changes: 13 additions & 16 deletions Marlin/src/pins/mega/pins_MEGATRONICS_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,19 @@
#define X_DIR_PIN 57
#define X_ENABLE_PIN 59

#define Y_STEP_PIN 5
#define Y_DIR_PIN 17
#define Y_ENABLE_PIN 4
#if ENABLED(REPRAPWORLD_KEYPAD) && EXTRUDERS <= 2
#define Y_ENABLE_PIN 23
#define Y_STEP_PIN 22
#define Y_DIR_PIN 60
#else
#define Y_STEP_PIN 5
#define Y_DIR_PIN 17
#define Y_ENABLE_PIN 4

#define E2_STEP_PIN 22
#define E2_DIR_PIN 60
#define E2_ENABLE_PIN 23
#endif

#define Z_STEP_PIN 16
#define Z_DIR_PIN 11
Expand All @@ -83,10 +93,6 @@
#define E1_DIR_PIN 24
#define E1_ENABLE_PIN 26

#define E2_STEP_PIN 22
#define E2_DIR_PIN 60
#define E2_ENABLE_PIN 23

//
// Temperature Sensors
//
Expand Down Expand Up @@ -181,15 +187,6 @@
#elif EXTRUDERS <= 2
// Hijack the last extruder so that we can get the PWM signal off the Y breakout
// Move Y to the E2 plug. This makes dual Y steppers harder
#undef Y_ENABLE_PIN // 4
#undef Y_STEP_PIN // 5
#undef Y_DIR_PIN // 17
#undef E2_ENABLE_PIN // 23
#undef E2_STEP_PIN // 22
#undef E2_DIR_PIN // 60
#define Y_ENABLE_PIN 23
#define Y_STEP_PIN 22
#define Y_DIR_PIN 60
#define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM
#define SPINDLE_LASER_ENA_PIN 17 // Pullup!
#define SPINDLE_DIR_PIN 5
Expand Down
135 changes: 69 additions & 66 deletions Marlin/src/pins/ramps/pins_3DRAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@
#define DEFAULT_SOURCE_CODE_URL "3dprint.elettronicain.it"
#endif

//
// Limit Switches
//
#define Z_STOP_PIN 18

//
// Steppers
//
#if HAS_CUTTER
#define Z_DIR_PIN 28
#define Z_ENABLE_PIN 24
#define Z_STEP_PIN 26
#else
#define Z_ENABLE_PIN 63
#endif

#if HAS_CUTTER && !HAS_EXTRUDERS
#define E0_DIR_PIN -1
#define E0_ENABLE_PIN -1
#define E0_STEP_PIN -1
#endif

//
// Heaters / Fans
//
Expand All @@ -53,18 +75,54 @@
#define CASE_LIGHT_PIN -1 // Hardware PWM but one is not available on expansion header
#endif

#include "pins_RAMPS.h"

//
// Limit Switches
//
#undef Z_MAX_PIN
/**
* M3/M4/M5 - Spindle/Laser Control
*
* If you want to control the speed of your spindle then you'll have
* have to sacrifce the Extruder and pull some signals off the Z stepper
* driver socket.
*
* The following assumes:
* - the Z stepper driver socket is empty
* - the extruder driver socket has a driver board plugged into it
* - the Z stepper wires are attached the the extruder connector
*
* If you want to keep the extruder AND don't have a LCD display then
* you can still control the power on/off and spindle direction.
*
* Where to get spindle signals
*
* stepper signal socket name socket name
* -------
* SPINDLE_LASER_ENA_PIN /ENABLE O| |O VMOT
* MS1 O| |O GND
* MS2 O| |O 2B
* MS3 O| |O 2A
* /RESET O| |O 1A
* /SLEEP O| |O 1B
* SPINDLE_LASER_PWM_PIN STEP O| |O VDD
* SPINDLE_DIR_PIN DIR O| |O GND
* -------
*
* Note: Socket names vary from vendor to vendor
*/
#if HAS_CUTTER
#if !HAS_EXTRUDERS
#define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM
#define SPINDLE_LASER_ENA_PIN 62 // Pullup!
#define SPINDLE_DIR_PIN 48
#elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use
#define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown!
#define SPINDLE_DIR_PIN 17
#if !NUM_SERVOS // Use servo connector if possible
#define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM
#elif HAS_FREE_AUX2_PINS
#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
#endif
#endif
#endif

//
// Steppers
//
#undef Z_ENABLE_PIN
#define Z_ENABLE_PIN 63
#include "pins_RAMPS.h"

//
// Heaters / Fans
Expand Down Expand Up @@ -113,58 +171,3 @@
#define BOARD_ST7920_DELAY_2 188
#define BOARD_ST7920_DELAY_3 0
#endif

/**
* M3/M4/M5 - Spindle/Laser Control
*
* If you want to control the speed of your spindle then you'll have
* have to sacrifce the Extruder and pull some signals off the Z stepper
* driver socket.
*
* The following assumes:
* - the Z stepper driver socket is empty
* - the extruder driver socket has a driver board plugged into it
* - the Z stepper wires are attached the the extruder connector
*
* If you want to keep the extruder AND don't have a LCD display then
* you can still control the power on/off and spindle direction.
*
* Where to get spindle signals
*
* stepper signal socket name socket name
* -------
* SPINDLE_LASER_ENA_PIN /ENABLE O| |O VMOT
* MS1 O| |O GND
* MS2 O| |O 2B
* MS3 O| |O 2A
* /RESET O| |O 1A
* /SLEEP O| |O 1B
* SPINDLE_LASER_PWM_PIN STEP O| |O VDD
* SPINDLE_DIR_PIN DIR O| |O GND
* -------
*
* Note: Socket names vary from vendor to vendor
*/
#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not good with 3DRAG
#undef SPINDLE_LASER_ENA_PIN
#undef SPINDLE_DIR_PIN

#if HAS_CUTTER
#if !HAS_EXTRUDERS
#undef E0_DIR_PIN
#undef E0_ENABLE_PIN
#undef E0_STEP_PIN
#undef Z_DIR_PIN
#undef Z_ENABLE_PIN
#undef Z_STEP_PIN
#define Z_DIR_PIN 28
#define Z_ENABLE_PIN 24
#define Z_STEP_PIN 26
#define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM
#define SPINDLE_LASER_ENA_PIN 62 // Pullup!
#define SPINDLE_DIR_PIN 48
#elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use
#define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown!
#define SPINDLE_DIR_PIN 17
#endif
#endif
96 changes: 45 additions & 51 deletions Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,41 @@

#define BOARD_INFO_NAME "ZUM Mega 3D"

//
// Limit Switches
//
#define X_MAX_PIN 79

// This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team
// decided to ship the printer only with the probe and no additional Z-min
// endstop and the instruction manual advises the user to connect the probe to
// IND_S_5V the option Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN will not work.
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define Z_MIN_PIN 19 // IND_S_5V
#define Z_MAX_PIN 18 // Z-MIN Label
#endif

//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 19 // IND_S_5V
#endif

//
// Steppers
//
#define Z_ENABLE_PIN 77

#define DIGIPOTSS_PIN 22
#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 }

//
// Temperature Sensors
//
#define TEMP_1_PIN 14 // Analog Input
#define TEMP_BED_PIN 15 // Analog Input

//
// Heaters / Fans
//
Expand Down Expand Up @@ -61,72 +96,31 @@
#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
#define SPINDLE_DIR_PIN 42

//
// Limit Switches
//
#define X_MAX_PIN 79 // 2

//
// Import RAMPS 1.3 pins
//
#include "pins_RAMPS_13.h"

//
// Z Probe (when not Z_MIN_PIN)
//
#undef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 19 // IND_S_5V

#undef Z_ENABLE_PIN
#define Z_ENABLE_PIN 77 // 62

//
// Steppers
//
#define DIGIPOTSS_PIN 22
#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 }

//
// Temperature Sensors
//
#undef TEMP_1_PIN
#define TEMP_1_PIN 14 // Analog Input (15)

#undef TEMP_BED_PIN
#define TEMP_BED_PIN 15 // Analog Input (14)

//
// Misc. Functions
//
#undef PS_ON_PIN // 12
#define PS_ON_PIN 81 // External Power Supply

#ifndef CASE_LIGHT_PIN
#define CASE_LIGHT_PIN 44 // Hardware PWM
#endif

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

//
// Import RAMPS 1.3 pins
//
#include "pins_RAMPS_13.h"

//
// Used by the Hephestos 2 heated bed upgrade kit
//
#if ENABLED(HEPHESTOS2_HEATED_BED_KIT)
#undef HEATER_BED_PIN
#define HEATER_BED_PIN 8
#endif

// Alter timing for graphical display
#if ENABLED(U8GLIB_ST7920)
#define BOARD_ST7920_DELAY_1 0
#define BOARD_ST7920_DELAY_2 0
#define BOARD_ST7920_DELAY_3 189
#endif
25 changes: 9 additions & 16 deletions Marlin/src/pins/ramps/pins_K8400.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,22 @@
#define BOARD_INFO_NAME "K8400"
#define DEFAULT_MACHINE_NAME "Vertex"

#include "pins_3DRAG.h"
//
// Steppers
//
#if HAS_CUTTER
#define Z_STEP_PIN 32
#endif

#define E1_STEP_PIN 32

//
// Limit Switches
//
#define X_STOP_PIN 3
#define Y_STOP_PIN 14

#undef X_MIN_PIN
#undef X_MAX_PIN
#undef Y_MIN_PIN
#undef Y_MAX_PIN

//
// Steppers
//
#undef E1_STEP_PIN
#define E1_STEP_PIN 32
#include "pins_3DRAG.h"

//
// Heaters / Fans
Expand All @@ -66,8 +64,3 @@
#undef PS_ON_PIN
#undef KILL_PIN
#undef SD_DETECT_PIN

#if Z_STEP_PIN == 26
#undef Z_STEP_PIN
#define Z_STEP_PIN 32
#endif
11 changes: 5 additions & 6 deletions Marlin/src/pins/ramps/pins_K8600.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
#define Z_MAX_PIN 18
#define Z_MIN_PIN -1

//
// Steppers
//
#define Z_ENABLE_PIN 63

//
// Heaters / Fans
//
Expand All @@ -57,12 +62,6 @@
#define IS_RAMPS_EFB // Override autodetection. Bed will be undefined.
#include "pins_RAMPS.h"

//
// Steppers
//
#undef Z_ENABLE_PIN
#define Z_ENABLE_PIN 63

//
// Heaters / Fans
//
Expand Down
Loading

0 comments on commit 99647fa

Please sign in to comment.