|
@@ -462,91 +462,91 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
462
|
462
|
#if EXTRUDERS > 7
|
463
|
463
|
#define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else if (E < 6) { E2_STEP_WRITE(V); } else { E3_STEP_WRITE(V); } }while(0)
|
464
|
464
|
#define NORM_E_DIR(E) do{ switch (E) { \
|
465
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \
|
466
|
|
- case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
467
|
|
- case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \
|
468
|
|
- case 6: E3_DIR_WRITE( INVERT_E3_DIR); break; case 7: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
|
465
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \
|
|
466
|
+ case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
467
|
+ case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \
|
|
468
|
+ case 6: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; case 7: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
469
|
469
|
} }while(0)
|
470
|
470
|
#define REV_E_DIR(E) do{ switch (E) { \
|
471
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \
|
472
|
|
- case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
473
|
|
- case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \
|
474
|
|
- case 6: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 7: E3_DIR_WRITE(!INVERT_E3_DIR); break; \
|
|
471
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \
|
|
472
|
+ case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
473
|
+ case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \
|
|
474
|
+ case 6: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; case 7: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \
|
475
|
475
|
} }while(0)
|
476
|
476
|
#elif EXTRUDERS > 6
|
477
|
477
|
#define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else if (E < 6) { E2_STEP_WRITE(V); } else { E3_STEP_WRITE(V); } }while(0)
|
478
|
478
|
#define NORM_E_DIR(E) do{ switch (E) { \
|
479
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \
|
480
|
|
- case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
481
|
|
- case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \
|
482
|
|
- case 6: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
|
479
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \
|
|
480
|
+ case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
481
|
+ case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \
|
|
482
|
+ case 6: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
483
|
483
|
} }while(0)
|
484
|
484
|
#define REV_E_DIR(E) do{ switch (E) { \
|
485
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \
|
486
|
|
- case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
487
|
|
- case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \
|
488
|
|
- case 6: E3_DIR_WRITE(!INVERT_E3_DIR); } }while(0)
|
|
485
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \
|
|
486
|
+ case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
487
|
+ case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \
|
|
488
|
+ case 6: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); } }while(0)
|
489
|
489
|
#elif EXTRUDERS > 5
|
490
|
490
|
#define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0)
|
491
|
491
|
#define NORM_E_DIR(E) do{ switch (E) { \
|
492
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \
|
493
|
|
- case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
494
|
|
- case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \
|
|
492
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \
|
|
493
|
+ case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
494
|
+ case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \
|
495
|
495
|
} }while(0)
|
496
|
496
|
#define REV_E_DIR(E) do{ switch (E) { \
|
497
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \
|
498
|
|
- case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
499
|
|
- case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \
|
|
497
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \
|
|
498
|
+ case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
499
|
+ case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \
|
500
|
500
|
} }while(0)
|
501
|
501
|
#elif EXTRUDERS > 4
|
502
|
502
|
#define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0)
|
503
|
503
|
#define NORM_E_DIR(E) do{ switch (E) { \
|
504
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \
|
505
|
|
- case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
506
|
|
- case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; \
|
|
504
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \
|
|
505
|
+ case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
506
|
+ case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \
|
507
|
507
|
} }while(0)
|
508
|
508
|
#define REV_E_DIR(E) do{ switch (E) { \
|
509
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \
|
510
|
|
- case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
511
|
|
- case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; \
|
|
509
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \
|
|
510
|
+ case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
511
|
+ case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \
|
512
|
512
|
} }while(0)
|
513
|
513
|
#elif EXTRUDERS > 3
|
514
|
514
|
#define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0)
|
515
|
515
|
#define NORM_E_DIR(E) do{ switch (E) { \
|
516
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \
|
517
|
|
- case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
|
516
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \
|
|
517
|
+ case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
518
|
518
|
} }while(0)
|
519
|
519
|
#define REV_E_DIR(E) do{ switch (E) { \
|
520
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \
|
521
|
|
- case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
|
520
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \
|
|
521
|
+ case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
522
|
522
|
} }while(0)
|
523
|
523
|
#elif EXTRUDERS > 2
|
524
|
524
|
#define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0)
|
525
|
525
|
#define NORM_E_DIR(E) do{ switch (E) { \
|
526
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \
|
527
|
|
- case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
|
526
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \
|
|
527
|
+ case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
528
|
528
|
} }while(0)
|
529
|
529
|
#define REV_E_DIR(E) do{ switch (E) { \
|
530
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \
|
531
|
|
- case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
|
530
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \
|
|
531
|
+ case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
532
|
532
|
} }while(0)
|
533
|
533
|
#else
|
534
|
534
|
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
|
535
|
|
- #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0)
|
536
|
|
- #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0)
|
|
535
|
+ #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? ENABLED(INVERT_E0_DIR) : DISABLED(INVERT_E0_DIR)); }while(0)
|
|
536
|
+ #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? DISABLED(INVERT_E0_DIR) : ENABLED(INVERT_E0_DIR)); }while(0)
|
537
|
537
|
#endif
|
538
|
538
|
|
539
|
539
|
#elif HAS_PRUSA_MMU2 // One multiplexed stepper driver
|
540
|
540
|
|
541
|
541
|
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
|
542
|
|
- #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
|
543
|
|
- #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)
|
|
542
|
+ #define NORM_E_DIR(E) E0_DIR_WRITE(DISABLED(INVERT_E0_DIR))
|
|
543
|
+ #define REV_E_DIR(E) E0_DIR_WRITE( ENABLED(INVERT_E0_DIR))
|
544
|
544
|
|
545
|
545
|
#elif HAS_PRUSA_MMU1 // One multiplexed stepper driver, reversed on odd index
|
546
|
546
|
|
547
|
547
|
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
|
548
|
|
- #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0)
|
549
|
|
- #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0)
|
|
548
|
+ #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? DISABLED(INVERT_E0_DIR): ENABLED(INVERT_E0_DIR)); }while(0)
|
|
549
|
+ #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? ENABLED(INVERT_E0_DIR): DISABLED(INVERT_E0_DIR)); }while(0)
|
550
|
550
|
|
551
|
551
|
#elif E_STEPPERS > 1
|
552
|
552
|
|
|
@@ -557,16 +557,16 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
557
|
557
|
case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; case 6: E6_STEP_WRITE(V); break; case 7: E7_STEP_WRITE(V); break; \
|
558
|
558
|
} }while(0)
|
559
|
559
|
#define _NORM_E_DIR(E) do{ switch (E) { \
|
560
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
561
|
|
- case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \
|
562
|
|
- case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \
|
563
|
|
- case 6: E6_DIR_WRITE(!INVERT_E6_DIR); break; case 7: E7_DIR_WRITE(!INVERT_E7_DIR); break; \
|
|
560
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
561
|
+ case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \
|
|
562
|
+ case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE(DISABLED(INVERT_E5_DIR)); break; \
|
|
563
|
+ case 6: E6_DIR_WRITE(DISABLED(INVERT_E6_DIR)); break; case 7: E7_DIR_WRITE(DISABLED(INVERT_E7_DIR)); break; \
|
564
|
564
|
} }while(0)
|
565
|
565
|
#define _REV_E_DIR(E) do{ switch (E) { \
|
566
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
567
|
|
- case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
568
|
|
- case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \
|
569
|
|
- case 6: E6_DIR_WRITE( INVERT_E6_DIR); break; case 7: E7_DIR_WRITE( INVERT_E7_DIR); break; \
|
|
566
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
567
|
+ case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
|
568
|
+ case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE( ENABLED(INVERT_E5_DIR)); break; \
|
|
569
|
+ case 6: E6_DIR_WRITE( ENABLED(INVERT_E6_DIR)); break; case 7: E7_DIR_WRITE( ENABLED(INVERT_E7_DIR)); break; \
|
570
|
570
|
} }while(0)
|
571
|
571
|
|
572
|
572
|
#elif E_STEPPERS > 6
|
|
@@ -576,16 +576,16 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
576
|
576
|
case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; case 6: E6_STEP_WRITE(V); break; \
|
577
|
577
|
} }while(0)
|
578
|
578
|
#define _NORM_E_DIR(E) do{ switch (E) { \
|
579
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
580
|
|
- case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \
|
581
|
|
- case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \
|
582
|
|
- case 6: E6_DIR_WRITE(!INVERT_E6_DIR); break; \
|
|
579
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
580
|
+ case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \
|
|
581
|
+ case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE(DISABLED(INVERT_E5_DIR)); break; \
|
|
582
|
+ case 6: E6_DIR_WRITE(DISABLED(INVERT_E6_DIR)); break; \
|
583
|
583
|
} }while(0)
|
584
|
584
|
#define _REV_E_DIR(E) do{ switch (E) { \
|
585
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
586
|
|
- case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
587
|
|
- case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \
|
588
|
|
- case 6: E6_DIR_WRITE( INVERT_E6_DIR); break; \
|
|
585
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
586
|
+ case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
|
587
|
+ case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE( ENABLED(INVERT_E5_DIR)); break; \
|
|
588
|
+ case 6: E6_DIR_WRITE( ENABLED(INVERT_E6_DIR)); break; \
|
589
|
589
|
} }while(0)
|
590
|
590
|
|
591
|
591
|
#elif E_STEPPERS > 5
|
|
@@ -595,14 +595,14 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
595
|
595
|
case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; \
|
596
|
596
|
} }while(0)
|
597
|
597
|
#define _NORM_E_DIR(E) do{ switch (E) { \
|
598
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
599
|
|
- case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \
|
600
|
|
- case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \
|
|
598
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
599
|
+ case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \
|
|
600
|
+ case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE(DISABLED(INVERT_E5_DIR)); break; \
|
601
|
601
|
} }while(0)
|
602
|
602
|
#define _REV_E_DIR(E) do{ switch (E) { \
|
603
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
604
|
|
- case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
605
|
|
- case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \
|
|
603
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
604
|
+ case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
|
605
|
+ case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE( ENABLED(INVERT_E5_DIR)); break; \
|
606
|
606
|
} }while(0)
|
607
|
607
|
|
608
|
608
|
#elif E_STEPPERS > 4
|
|
@@ -612,14 +612,14 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
612
|
612
|
case 4: E4_STEP_WRITE(V); break; \
|
613
|
613
|
} }while(0)
|
614
|
614
|
#define _NORM_E_DIR(E) do{ switch (E) { \
|
615
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
616
|
|
- case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \
|
617
|
|
- case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; \
|
|
615
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
616
|
+ case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \
|
|
617
|
+ case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; \
|
618
|
618
|
} }while(0)
|
619
|
619
|
#define _REV_E_DIR(E) do{ switch (E) { \
|
620
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
621
|
|
- case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
622
|
|
- case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; \
|
|
620
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
621
|
+ case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
|
622
|
+ case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; \
|
623
|
623
|
} }while(0)
|
624
|
624
|
|
625
|
625
|
#elif E_STEPPERS > 3
|
|
@@ -628,25 +628,25 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
628
|
628
|
case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \
|
629
|
629
|
} }while(0)
|
630
|
630
|
#define _NORM_E_DIR(E) do{ switch (E) { \
|
631
|
|
- case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \
|
632
|
|
- case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \
|
|
631
|
+ case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \
|
|
632
|
+ case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \
|
633
|
633
|
} }while(0)
|
634
|
634
|
#define _REV_E_DIR(E) do{ switch (E) { \
|
635
|
|
- case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \
|
636
|
|
- case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \
|
|
635
|
+ case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \
|
|
636
|
+ case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \
|
637
|
637
|
} }while(0)
|
638
|
638
|
|
639
|
639
|
#elif E_STEPPERS > 2
|
640
|
640
|
|
641
|
641
|
#define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); } }while(0)
|
642
|
|
- #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0)
|
643
|
|
- #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0)
|
|
642
|
+ #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); } }while(0)
|
|
643
|
+ #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); } }while(0)
|
644
|
644
|
|
645
|
645
|
#else
|
646
|
646
|
|
647
|
647
|
#define _E_STEP_WRITE(E,V) do{ if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0)
|
648
|
|
- #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0)
|
649
|
|
- #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0)
|
|
648
|
+ #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); } else { E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); } }while(0)
|
|
649
|
+ #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); } else { E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); } }while(0)
|
650
|
650
|
#endif
|
651
|
651
|
|
652
|
652
|
#if HAS_DUPLICATION_MODE
|
|
@@ -657,8 +657,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
657
|
657
|
#define _DUPE(N,T,V) E##N##_##T##_WRITE(V)
|
658
|
658
|
#endif
|
659
|
659
|
|
660
|
|
- #define NDIR(N) _DUPE(N,DIR,!INVERT_E##N##_DIR)
|
661
|
|
- #define RDIR(N) _DUPE(N,DIR, INVERT_E##N##_DIR)
|
|
660
|
+ #define NDIR(N) _DUPE(N,DIR,DISABLED(INVERT_E##N##_DIR))
|
|
661
|
+ #define RDIR(N) _DUPE(N,DIR, ENABLED(INVERT_E##N##_DIR))
|
662
|
662
|
|
663
|
663
|
#define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0)
|
664
|
664
|
|
|
@@ -704,13 +704,13 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
704
|
704
|
|
705
|
705
|
#elif ENABLED(E_DUAL_STEPPER_DRIVERS)
|
706
|
706
|
#define E_STEP_WRITE(E,V) do{ E0_STEP_WRITE(V); E1_STEP_WRITE(V); }while(0)
|
707
|
|
- #define NORM_E_DIR(E) do{ E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E0_DIR ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0)
|
708
|
|
- #define REV_E_DIR(E) do{ E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E0_DIR ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0)
|
|
707
|
+ #define NORM_E_DIR(E) do{ E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); E1_DIR_WRITE(DISABLED(INVERT_E0_DIR) ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0)
|
|
708
|
+ #define REV_E_DIR(E) do{ E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); E1_DIR_WRITE( ENABLED(INVERT_E0_DIR) ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0)
|
709
|
709
|
|
710
|
710
|
#elif E_STEPPERS
|
711
|
711
|
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
|
712
|
|
- #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
|
713
|
|
- #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)
|
|
712
|
+ #define NORM_E_DIR(E) E0_DIR_WRITE(DISABLED(INVERT_E0_DIR))
|
|
713
|
+ #define REV_E_DIR(E) E0_DIR_WRITE( ENABLED(INVERT_E0_DIR))
|
714
|
714
|
|
715
|
715
|
#else
|
716
|
716
|
#define E_STEP_WRITE(E,V) NOOP
|