Skip to content

Commit

Permalink
⚡️ Formbot ST7920 delays, intentional X2 pins (#22915)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
InsanityAutomation and thinkyhead authored Oct 13, 2021
1 parent bf91bd5 commit 8e49535
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,9 @@
#endif

// Fallback Stepper Driver types that depend on Configuration_adv.h
#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#define HAS_X2_STEPPER 1
#else
#undef X2_DRIVER_TYPE
#endif
#if DISABLED(Y_DUAL_STEPPER_DRIVERS)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ void Stepper::init() {
#if HAS_X_ENABLE
X_ENABLE_INIT();
if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH);
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) && HAS_X2_ENABLE
#if BOTH(HAS_X2_STEPPER, HAS_X2_ENABLE)
X2_ENABLE_INIT();
if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH);
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/pins_postprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,12 +579,12 @@
#endif

// The X2 axis, if any, should be the next open extruder port
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) && !defined(X2_DIAG_PIN) && !defined(X2_STEP_PIN) && !PIN_EXISTS(X2_CS_PIN)
#if HAS_X2_STEPPER && !defined(X2_DIAG_PIN) && !defined(X2_STEP_PIN) && !PIN_EXISTS(X2_CS_PIN)
#define Y2_E_INDEX INCREMENT(X2_E_INDEX)
#else
#define Y2_E_INDEX X2_E_INDEX
#endif
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#if HAS_X2_STEPPER
#ifndef X2_STEP_PIN
#define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP)
#define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR)
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@
#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && (CASE_LIGHT_PIN == SPINDLE_LASER_ENA_PIN || CASE_LIGHT_PIN == SPINDLE_LASER_PWM_PIN)
#error "CASE_LIGHT_PIN conflicts with a Spindle / Laser pin."
#endif

#if HAS_MARLINUI_U8GLIB
#define BOARD_ST7920_DELAY_1 125
#define BOARD_ST7920_DELAY_2 125
#define BOARD_ST7920_DELAY_3 125
#endif
18 changes: 15 additions & 3 deletions Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,15 @@
#define E1_CS_PIN 44
#endif

#define E2_STEP_PIN 42
#define E2_DIR_PIN 43
#define E2_ENABLE_PIN 44
#if HAS_X2_STEPPER
#define X2_STEP_PIN 42
#define X2_DIR_PIN 43
#define X2_ENABLE_PIN 44
#else
#define E2_STEP_PIN 42
#define E2_DIR_PIN 43
#define E2_ENABLE_PIN 44
#endif

//
// Temperature Sensors
Expand Down Expand Up @@ -174,3 +180,9 @@
#define BEEPER_PIN 37
#endif
#endif

#if HAS_MARLINUI_U8GLIB
#define BOARD_ST7920_DELAY_1 125
#define BOARD_ST7920_DELAY_2 125
#define BOARD_ST7920_DELAY_3 125
#endif
2 changes: 1 addition & 1 deletion Marlin/src/pins/sensitive_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@
// Chip Select and Digital Micro-stepping
//

#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#if HAS_X2_STEPPER
#if PIN_EXISTS(X2_CS) && AXIS_HAS_SPI(X2)
#define _X2_CS X2_CS_PIN,
#else
Expand Down

0 comments on commit 8e49535

Please sign in to comment.