1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

🎨 Less use of undef for RAMPS pins

This commit is contained in:
Scott Lahteine 2021-09-22 00:19:26 -05:00
parent 0387f94632
commit 11ceea25ce
11 changed files with 224 additions and 243 deletions

View File

@ -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
@ -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
//
@ -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

View File

@ -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
//
@ -53,19 +75,55 @@
#define CASE_LIGHT_PIN -1 // Hardware PWM but one is not available on expansion header
#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
*/
#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
#include "pins_RAMPS.h"
//
// Limit Switches
//
#undef Z_MAX_PIN
//
// Steppers
//
#undef Z_ENABLE_PIN
#define Z_ENABLE_PIN 63
//
// Heaters / Fans
//
@ -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

View File

@ -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
//
@ -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
#endif
//
// 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
//
// 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

View File

@ -35,7 +35,14 @@
#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
@ -43,16 +50,7 @@
#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
@ -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

View File

@ -40,6 +40,11 @@
#define Z_MAX_PIN 18
#define Z_MIN_PIN -1
//
// Steppers
//
#define Z_ENABLE_PIN 63
//
// Heaters / Fans
//
@ -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
//

View File

@ -82,11 +82,31 @@
#define Z_MAX_PIN 37
#endif
#undef CHANGE_Y_LIMIT_PINS
//
// Steppers - No E1 pins
//
#define E1_STEP_PIN -1
#define E1_DIR_PIN -1
#define E1_ENABLE_PIN -1
#define E1_CS_PIN -1
//
// Z Probe (when not Z_MIN_PIN)
//
#define Z_MIN_PROBE_PIN -1
//
// Temperature Sensors
//
#define TEMP_1_PIN -1
//
// Průša i3 MK2 Multiplexer Support
//
#define E_MUX2_PIN -1
//
// Misc. Functions
//
@ -98,22 +118,3 @@
//
#define IS_RAMPS_EFB // Override autodetection. Bed will be undefined.
#include "pins_RAMPS_13.h"
//
// Steppers
//
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN
#undef E1_CS_PIN
//
// Temperature Sensors
//
#undef TEMP_1_PIN
//
// Průša i3 MK2 Multiplexer Support
//
#undef E_MUX2_PIN
#undef CHANGE_Y_LIMIT_PINS

View File

@ -45,7 +45,14 @@
//
// Steppers
//
#define E0_STEP_PIN 36
#define E0_DIR_PIN 34
#define E0_ENABLE_PIN 30
#define E0_CS_PIN 44
#define E1_STEP_PIN 26
#define E1_DIR_PIN 28
#define E1_ENABLE_PIN 24
#define E1_CS_PIN 42
//
@ -70,23 +77,6 @@
#include "pins_RAMPS.h"
//
// Steppers
//
#undef E0_STEP_PIN
#undef E0_DIR_PIN
#undef E0_ENABLE_PIN
#define E0_STEP_PIN 36
#define E0_DIR_PIN 34
#define E0_ENABLE_PIN 30
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN
#define E1_STEP_PIN 26
#define E1_DIR_PIN 28
#define E1_ENABLE_PIN 24
//
// LCD / Controller
//

View File

@ -133,22 +133,38 @@
#ifndef Z_STEP_PIN
#define Z_STEP_PIN 46
#endif
#define Z_DIR_PIN 48
#define Z_ENABLE_PIN 62
#ifndef Z_DIR_PIN
#define Z_DIR_PIN 48
#endif
#ifndef Z_ENABLE_PIN
#define Z_ENABLE_PIN 62
#endif
#ifndef Z_CS_PIN
#define Z_CS_PIN 40
#endif
#define E0_STEP_PIN 26
#define E0_DIR_PIN 28
#define E0_ENABLE_PIN 24
#ifndef E0_STEP_PIN
#define E0_STEP_PIN 26
#endif
#ifndef E0_DIR_PIN
#define E0_DIR_PIN 28
#endif
#ifndef E0_ENABLE_PIN
#define E0_ENABLE_PIN 24
#endif
#ifndef E0_CS_PIN
#define E0_CS_PIN 42
#endif
#define E1_STEP_PIN 36
#define E1_DIR_PIN 34
#define E1_ENABLE_PIN 30
#ifndef E1_STEP_PIN
#define E1_STEP_PIN 36
#endif
#ifndef E1_DIR_PIN
#define E1_DIR_PIN 34
#endif
#ifndef E1_ENABLE_PIN
#define E1_ENABLE_PIN 30
#endif
#ifndef E1_CS_PIN
#define E1_CS_PIN 44
#endif
@ -219,10 +235,10 @@
#define FAN1_PIN RAMPS_D8_PIN
#elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
#define HEATER_BED_PIN RAMPS_D8_PIN
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#define FAN1_PIN MOSFET_D_PIN
#else
#if EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL)
#define HEATER_1_PIN MOSFET_D_PIN
#else
#define FAN1_PIN MOSFET_D_PIN
#endif
#endif

View File

@ -44,32 +44,25 @@
#define RAMPS_D8_PIN 10
#define RAMPS_D10_PIN 8
#include "pins_RAMPS.h"
//
// Steppers - Swap E0 / E1 on 3DYMY
// Steppers
//
#undef E0_STEP_PIN
#undef E0_DIR_PIN
#undef E0_ENABLE_PIN
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN
#define X_CS_PIN -1
#define Y_CS_PIN -1
#define Z_CS_PIN -1
// Swap E0 / E1 on 3DYMY
#define E0_STEP_PIN 36
#define E0_DIR_PIN 34
#define E0_ENABLE_PIN 30
#define E0_CS_PIN -1
#define E1_STEP_PIN 26
#define E1_DIR_PIN 28
#define E1_ENABLE_PIN 24
#define E1_CS_PIN -1
#undef X_CS_PIN
#undef Y_CS_PIN
#undef Z_CS_PIN
#undef E0_CS_PIN
#undef E1_CS_PIN
#include "pins_RAMPS.h"
#if IS_ULTRA_LCD && NONE(REPRAPWORLD_GRAPHICAL_LCD, CR10_STOCKDISPLAY) && !BOTH(IS_NEWPANEL, PANEL_ONE)
#if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)

View File

@ -29,6 +29,18 @@
#define BOARD_INFO_NAME "RigidBoard"
#endif
//
// Steppers
// RigidBot swaps E0 / E1 plugs vs RAMPS 1.3
//
#define E0_STEP_PIN 36
#define E0_DIR_PIN 34
#define E0_ENABLE_PIN 30
#define E1_STEP_PIN 26
#define E1_DIR_PIN 28
#define E1_ENABLE_PIN 24
//
// Z Probe (when not Z_MIN_PIN)
//
@ -45,24 +57,6 @@
#include "pins_RAMPS.h"
//
// Steppers
//
// RigidBot swaps E0 / E1 plugs vs RAMPS 1.3
#undef E0_STEP_PIN
#undef E0_DIR_PIN
#undef E0_ENABLE_PIN
#define E0_STEP_PIN 36
#define E0_DIR_PIN 34
#define E0_ENABLE_PIN 30
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN
#define E1_STEP_PIN 26
#define E1_DIR_PIN 28
#define E1_ENABLE_PIN 24
#define STEPPER_RESET_PIN 41 // Stepper drivers have a reset on RigidBot
//

View File

@ -29,6 +29,12 @@
#define IS_RAMPS_EFB
#define RAMPS_D9_PIN 44
#define E1_STEP_PIN -1
#define E1_DIR_PIN -1
#define E1_ENABLE_PIN -1
#define E1_CS_PIN -1
#define FAN2_PIN 9
#ifndef E0_AUTO_FAN_PIN
@ -36,8 +42,3 @@
#endif
#include "pins_RAMPS_13.h"
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN
#undef E1_CS_PIN