|
@@ -421,6 +421,11 @@ ISR(TIMER1_COMPA_vect)
|
421
|
421
|
|
422
|
422
|
if ((out_bits & (1<<Z_AXIS)) != 0) { // -direction
|
423
|
423
|
WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
|
424
|
+
|
|
425
|
+ #ifdef Z_DUAL_STEPPER_DRIVERS
|
|
426
|
+ WRITE(Z2_DIR_PIN,INVERT_Z_DIR);
|
|
427
|
+ #endif
|
|
428
|
+
|
424
|
429
|
count_direction[Z_AXIS]=-1;
|
425
|
430
|
CHECK_ENDSTOPS
|
426
|
431
|
{
|
|
@@ -437,6 +442,11 @@ ISR(TIMER1_COMPA_vect)
|
437
|
442
|
}
|
438
|
443
|
else { // +direction
|
439
|
444
|
WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
|
|
445
|
+
|
|
446
|
+ #ifdef Z_DUAL_STEPPER_DRIVERS
|
|
447
|
+ WRITE(Z2_DIR_PIN,!INVERT_Z_DIR);
|
|
448
|
+ #endif
|
|
449
|
+
|
440
|
450
|
count_direction[Z_AXIS]=1;
|
441
|
451
|
CHECK_ENDSTOPS
|
442
|
452
|
{
|
|
@@ -552,9 +562,18 @@ ISR(TIMER1_COMPA_vect)
|
552
|
562
|
counter_z += current_block->steps_z;
|
553
|
563
|
if (counter_z > 0) {
|
554
|
564
|
WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
|
565
|
+
|
|
566
|
+ #ifdef Z_DUAL_STEPPER_DRIVERS
|
|
567
|
+ WRITE(Z2_STEP_PIN, !INVERT_Z_STEP_PIN);
|
|
568
|
+ #endif
|
|
569
|
+
|
555
|
570
|
counter_z -= current_block->step_event_count;
|
556
|
571
|
count_position[Z_AXIS]+=count_direction[Z_AXIS];
|
557
|
572
|
WRITE(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
|
573
|
+
|
|
574
|
+ #ifdef Z_DUAL_STEPPER_DRIVERS
|
|
575
|
+ WRITE(Z2_STEP_PIN, INVERT_Z_STEP_PIN);
|
|
576
|
+ #endif
|
558
|
577
|
}
|
559
|
578
|
|
560
|
579
|
#ifndef ADVANCE
|
|
@@ -704,6 +723,10 @@ void st_init()
|
704
|
723
|
#endif
|
705
|
724
|
#if Z_DIR_PIN > -1
|
706
|
725
|
SET_OUTPUT(Z_DIR_PIN);
|
|
726
|
+
|
|
727
|
+ #if defined(Z_DUAL_STEPPER_DRIVERS) && (Z2_DIR_PIN > -1)
|
|
728
|
+ SET_OUTPUT(Z2_DIR_PIN);
|
|
729
|
+ #endif
|
707
|
730
|
#endif
|
708
|
731
|
#if E0_DIR_PIN > -1
|
709
|
732
|
SET_OUTPUT(E0_DIR_PIN);
|
|
@@ -728,6 +751,11 @@ void st_init()
|
728
|
751
|
#if (Z_ENABLE_PIN > -1)
|
729
|
752
|
SET_OUTPUT(Z_ENABLE_PIN);
|
730
|
753
|
if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH);
|
|
754
|
+
|
|
755
|
+ #if defined(Z_DUAL_STEPPER_DRIVERS) && (Z2_ENABLE_PIN > -1)
|
|
756
|
+ SET_OUTPUT(Z2_ENABLE_PIN);
|
|
757
|
+ if(!Z_ENABLE_ON) WRITE(Z2_ENABLE_PIN,HIGH);
|
|
758
|
+ #endif
|
731
|
759
|
#endif
|
732
|
760
|
#if (E0_ENABLE_PIN > -1)
|
733
|
761
|
SET_OUTPUT(E0_ENABLE_PIN);
|
|
@@ -802,6 +830,12 @@ void st_init()
|
802
|
830
|
SET_OUTPUT(Z_STEP_PIN);
|
803
|
831
|
WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN);
|
804
|
832
|
if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH);
|
|
833
|
+
|
|
834
|
+ #if defined(Z_DUAL_STEPPER_DRIVERS) && (Z2_STEP_PIN > -1)
|
|
835
|
+ SET_OUTPUT(Z2_STEP_PIN);
|
|
836
|
+ WRITE(Z2_STEP_PIN,INVERT_Z_STEP_PIN);
|
|
837
|
+ if(!Z_ENABLE_ON) WRITE(Z2_ENABLE_PIN,HIGH);
|
|
838
|
+ #endif
|
805
|
839
|
#endif
|
806
|
840
|
#if (E0_STEP_PIN > -1)
|
807
|
841
|
SET_OUTPUT(E0_STEP_PIN);
|