Introduce a layer of macro indirection to all stepper pins. This allows other stepper drivers to redefine them, so they can use SPI/I2C instead of direct pin manipulation.

This commit is contained in:
domonoky
2015-02-23 16:12:35 +01:00
parent a57869ba49
commit b55995aae8
5 changed files with 353 additions and 196 deletions

View File

@@ -4284,17 +4284,17 @@ void controllerFan()
{
lastMotorCheck = millis();
if(!READ(X_ENABLE_PIN) || !READ(Y_ENABLE_PIN) || !READ(Z_ENABLE_PIN) || (soft_pwm_bed > 0)
if(!READ(X_ENABLE_PIN) || !Y_ENABLE_READ || !Z_ENABLE_READ || (soft_pwm_bed > 0)
#if EXTRUDERS > 2
|| !READ(E2_ENABLE_PIN)
|| !E2_ENABLE_READ
#endif
#if EXTRUDER > 1
#if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
|| !READ(X2_ENABLE_PIN)
|| !X2_ENABLE_READ
#endif
|| !READ(E1_ENABLE_PIN)
|| !E1_ENABLE_READ)
#endif
|| !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...
|| !E0_ENABLE_READ) //If any of the drivers are enabled...
{
lastMotor = millis(); //... set time to NOW so the fan will turn on
}
@@ -4518,7 +4518,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
if( (millis() - previous_millis_cmd) > EXTRUDER_RUNOUT_SECONDS*1000 )
if(degHotend(active_extruder)>EXTRUDER_RUNOUT_MINTEMP)
{
bool oldstatus=READ(E0_ENABLE_PIN);
bool oldstatus=E0_ENABLE_READ;
enable_e0();
float oldepos=current_position[E_AXIS];
float oldedes=destination[E_AXIS];
@@ -4530,7 +4530,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
plan_set_e_position(oldepos);
previous_millis_cmd=millis();
st_synchronize();
WRITE(E0_ENABLE_PIN,oldstatus);
E0_ENABLE_WRITE(oldstatus);
}
#endif
#if defined(DUAL_X_CARRIAGE)