Add STEPPER_RESET_PIN support

This commit is contained in:
Scott Lahteine 2015-07-10 18:15:24 -07:00 committed by Richard Wackerbarth
parent a0351bdb73
commit 447dbd6fa5
2 changed files with 21 additions and 0 deletions

View file

@ -442,6 +442,7 @@
#define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1)) #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
#define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1)) #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
#define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1)) #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))

View file

@ -579,6 +579,17 @@ void servo_init() {
#endif #endif
} }
/**
* Stepper Reset (RigidBoard, et.al.)
*/
#if HAS_STEPPER_RESET
void disableStepperDrivers() {
pinMode(STEPPER_RESET_PIN, OUTPUT);
digitalWrite(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips
}
void enableStepperDrivers() { pinMode(STEPPER_RESET_PIN, INPUT); } // set to input, which allows it to be pulled high by pullups
#endif
/** /**
* Marlin entry-point: Set up before the program loop * Marlin entry-point: Set up before the program loop
* - Set up the kill pin, filament runout, power hold * - Set up the kill pin, filament runout, power hold
@ -601,6 +612,11 @@ void setup() {
setup_killpin(); setup_killpin();
setup_filrunoutpin(); setup_filrunoutpin();
setup_powerhold(); setup_powerhold();
#if HAS_STEPPER_RESET
disableStepperDrivers();
#endif
MYSERIAL.begin(BAUDRATE); MYSERIAL.begin(BAUDRATE);
SERIAL_PROTOCOLLNPGM("start"); SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START; SERIAL_ECHO_START;
@ -656,6 +672,10 @@ void setup() {
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
#endif #endif
#if HAS_STEPPER_RESET
enableStepperDrivers();
#endif
#ifdef DIGIPOT_I2C #ifdef DIGIPOT_I2C
digipot_i2c_init(); digipot_i2c_init();
#endif #endif