|
@@ -397,3 +397,260 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
397
|
397
|
#define REV_E_DIR(E) NOOP
|
398
|
398
|
|
399
|
399
|
#endif
|
|
400
|
+
|
|
401
|
+//
|
|
402
|
+// X, Y, Z Stepper enable / disable
|
|
403
|
+//
|
|
404
|
+#if AXIS_DRIVER_TYPE_X(L6470)
|
|
405
|
+ extern L6470 stepperX;
|
|
406
|
+ #define X_enable() NOOP
|
|
407
|
+ #define X_disable() stepperX.free()
|
|
408
|
+#elif HAS_X_ENABLE
|
|
409
|
+ #define X_enable() X_ENABLE_WRITE( X_ENABLE_ON)
|
|
410
|
+ #define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON)
|
|
411
|
+#else
|
|
412
|
+ #define X_enable() NOOP
|
|
413
|
+ #define X_disable() NOOP
|
|
414
|
+#endif
|
|
415
|
+
|
|
416
|
+#if AXIS_DRIVER_TYPE_X2(L6470)
|
|
417
|
+ extern L6470 stepperX2;
|
|
418
|
+ #define X2_enable() NOOP
|
|
419
|
+ #define X2_disable() stepperX2.free()
|
|
420
|
+#elif HAS_X2_ENABLE
|
|
421
|
+ #define X2_enable() X2_ENABLE_WRITE( X_ENABLE_ON)
|
|
422
|
+ #define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON)
|
|
423
|
+#else
|
|
424
|
+ #define X2_enable() NOOP
|
|
425
|
+ #define X2_disable() NOOP
|
|
426
|
+#endif
|
|
427
|
+
|
|
428
|
+#define enable_X() do{ X_enable(); X2_enable(); }while(0)
|
|
429
|
+#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0)
|
|
430
|
+
|
|
431
|
+#if AXIS_DRIVER_TYPE_Y(L6470)
|
|
432
|
+ extern L6470 stepperY;
|
|
433
|
+ #define Y_enable() NOOP
|
|
434
|
+ #define Y_disable() stepperY.free()
|
|
435
|
+#elif HAS_Y_ENABLE
|
|
436
|
+ #define Y_enable() Y_ENABLE_WRITE( Y_ENABLE_ON)
|
|
437
|
+ #define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON)
|
|
438
|
+#else
|
|
439
|
+ #define Y_enable() NOOP
|
|
440
|
+ #define Y_disable() NOOP
|
|
441
|
+#endif
|
|
442
|
+
|
|
443
|
+#if AXIS_DRIVER_TYPE_Y2(L6470)
|
|
444
|
+ extern L6470 stepperY2;
|
|
445
|
+ #define Y2_enable() NOOP
|
|
446
|
+ #define Y2_disable() stepperY2.free()
|
|
447
|
+#elif HAS_Y2_ENABLE
|
|
448
|
+ #define Y2_enable() Y2_ENABLE_WRITE( Y_ENABLE_ON)
|
|
449
|
+ #define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
|
|
450
|
+#else
|
|
451
|
+ #define Y2_enable() NOOP
|
|
452
|
+ #define Y2_disable() NOOP
|
|
453
|
+#endif
|
|
454
|
+
|
|
455
|
+#define enable_Y() do{ Y_enable(); Y2_enable(); }while(0)
|
|
456
|
+#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0)
|
|
457
|
+
|
|
458
|
+#if AXIS_DRIVER_TYPE_Z(L6470)
|
|
459
|
+ extern L6470 stepperZ;
|
|
460
|
+ #define Z_enable() NOOP
|
|
461
|
+ #define Z_disable() stepperZ.free()
|
|
462
|
+#elif HAS_Z_ENABLE
|
|
463
|
+ #define Z_enable() Z_ENABLE_WRITE( Z_ENABLE_ON)
|
|
464
|
+ #define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON)
|
|
465
|
+#else
|
|
466
|
+ #define Z_enable() NOOP
|
|
467
|
+ #define Z_disable() NOOP
|
|
468
|
+#endif
|
|
469
|
+
|
|
470
|
+#if AXIS_DRIVER_TYPE_Z2(L6470)
|
|
471
|
+ extern L6470 stepperZ2;
|
|
472
|
+ #define Z2_enable() NOOP
|
|
473
|
+ #define Z2_disable() stepperZ2.free()
|
|
474
|
+#elif HAS_Z2_ENABLE
|
|
475
|
+ #define Z2_enable() Z2_ENABLE_WRITE( Z_ENABLE_ON)
|
|
476
|
+ #define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
|
|
477
|
+#else
|
|
478
|
+ #define Z2_enable() NOOP
|
|
479
|
+ #define Z2_disable() NOOP
|
|
480
|
+#endif
|
|
481
|
+
|
|
482
|
+#if AXIS_DRIVER_TYPE_Z3(L6470)
|
|
483
|
+ extern L6470 stepperZ3;
|
|
484
|
+ #define Z3_enable() NOOP
|
|
485
|
+ #define Z3_disable() stepperZ3.free()
|
|
486
|
+#elif HAS_Z3_ENABLE
|
|
487
|
+ #define Z3_enable() Z3_ENABLE_WRITE( Z_ENABLE_ON)
|
|
488
|
+ #define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
|
|
489
|
+#else
|
|
490
|
+ #define Z3_enable() NOOP
|
|
491
|
+ #define Z3_disable() NOOP
|
|
492
|
+#endif
|
|
493
|
+
|
|
494
|
+#define enable_Z() do{ Z_enable(); Z2_enable(); Z3_enable(); }while(0)
|
|
495
|
+#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); CBI(axis_known_position, Z_AXIS); }while(0)
|
|
496
|
+
|
|
497
|
+//
|
|
498
|
+// Extruder Stepper enable / disable
|
|
499
|
+//
|
|
500
|
+
|
|
501
|
+// define the individual enables/disables
|
|
502
|
+#if AXIS_DRIVER_TYPE_E0(L6470)
|
|
503
|
+ extern L6470 stepperE0;
|
|
504
|
+ #define E0_enable() NOOP
|
|
505
|
+ #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
|
|
506
|
+#elif HAS_E0_ENABLE
|
|
507
|
+ #define E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON)
|
|
508
|
+ #define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON)
|
|
509
|
+#else
|
|
510
|
+ #define E0_enable() NOOP
|
|
511
|
+ #define E0_disable() NOOP
|
|
512
|
+#endif
|
|
513
|
+
|
|
514
|
+#if AXIS_DRIVER_TYPE_E1(L6470)
|
|
515
|
+ extern L6470 stepperE1;
|
|
516
|
+ #define E1_enable() NOOP
|
|
517
|
+ #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
|
|
518
|
+#elif E_STEPPERS > 1 && HAS_E1_ENABLE
|
|
519
|
+ #define E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON)
|
|
520
|
+ #define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON)
|
|
521
|
+#else
|
|
522
|
+ #define E1_enable() NOOP
|
|
523
|
+ #define E1_disable() NOOP
|
|
524
|
+#endif
|
|
525
|
+
|
|
526
|
+#if AXIS_DRIVER_TYPE_E2(L6470)
|
|
527
|
+ extern L6470 stepperE2;
|
|
528
|
+ #define E2_enable() NOOP
|
|
529
|
+ #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
|
|
530
|
+#elif E_STEPPERS > 2 && HAS_E2_ENABLE
|
|
531
|
+ #define E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON)
|
|
532
|
+ #define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON)
|
|
533
|
+#else
|
|
534
|
+ #define E2_enable() NOOP
|
|
535
|
+ #define E2_disable() NOOP
|
|
536
|
+#endif
|
|
537
|
+
|
|
538
|
+#if AXIS_DRIVER_TYPE_E3(L6470)
|
|
539
|
+ extern L6470 stepperE3;
|
|
540
|
+ #define E3_enable() NOOP
|
|
541
|
+ #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0)
|
|
542
|
+#elif E_STEPPERS > 3 && HAS_E3_ENABLE
|
|
543
|
+ #define E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON)
|
|
544
|
+ #define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON)
|
|
545
|
+#else
|
|
546
|
+ #define E3_enable() NOOP
|
|
547
|
+ #define E3_disable() NOOP
|
|
548
|
+#endif
|
|
549
|
+
|
|
550
|
+#if AXIS_DRIVER_TYPE_E4(L6470)
|
|
551
|
+ extern L6470 stepperE4;
|
|
552
|
+ #define E4_enable() NOOP
|
|
553
|
+ #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
|
|
554
|
+#elif E_STEPPERS > 4 && HAS_E4_ENABLE
|
|
555
|
+ #define E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON)
|
|
556
|
+ #define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON)
|
|
557
|
+#else
|
|
558
|
+ #define E4_enable() NOOP
|
|
559
|
+ #define E4_disable() NOOP
|
|
560
|
+#endif
|
|
561
|
+
|
|
562
|
+#if AXIS_DRIVER_TYPE_E5(L6470)
|
|
563
|
+ extern L6470 stepperE5;
|
|
564
|
+ #define E5_enable() NOOP
|
|
565
|
+ #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
|
|
566
|
+#elif E_STEPPERS > 5 && HAS_E5_ENABLE
|
|
567
|
+ #define E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON)
|
|
568
|
+ #define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON)
|
|
569
|
+#else
|
|
570
|
+ #define E5_enable() NOOP
|
|
571
|
+ #define E5_disable() NOOP
|
|
572
|
+#endif
|
|
573
|
+
|
|
574
|
+#if ENABLED(MIXING_EXTRUDER)
|
|
575
|
+
|
|
576
|
+ /**
|
|
577
|
+ * Mixing steppers synchronize their enable (and direction) together
|
|
578
|
+ */
|
|
579
|
+ #if MIXING_STEPPERS > 5
|
|
580
|
+ #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); }
|
|
581
|
+ #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); }
|
|
582
|
+ #elif MIXING_STEPPERS > 4
|
|
583
|
+ #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); }
|
|
584
|
+ #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); }
|
|
585
|
+ #elif MIXING_STEPPERS > 3
|
|
586
|
+ #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); }
|
|
587
|
+ #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); }
|
|
588
|
+ #elif MIXING_STEPPERS > 2
|
|
589
|
+ #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); }
|
|
590
|
+ #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); }
|
|
591
|
+ #else
|
|
592
|
+ #define enable_E0() { E0_enable(); E1_enable(); }
|
|
593
|
+ #define disable_E0() { E0_disable(); E1_disable(); }
|
|
594
|
+ #endif
|
|
595
|
+ #define enable_E1() NOOP
|
|
596
|
+ #define disable_E1() NOOP
|
|
597
|
+ #define enable_E2() NOOP
|
|
598
|
+ #define disable_E2() NOOP
|
|
599
|
+ #define enable_E3() NOOP
|
|
600
|
+ #define disable_E3() NOOP
|
|
601
|
+ #define enable_E4() NOOP
|
|
602
|
+ #define disable_E4() NOOP
|
|
603
|
+ #define enable_E5() NOOP
|
|
604
|
+ #define disable_E5() NOOP
|
|
605
|
+
|
|
606
|
+#else // !MIXING_EXTRUDER
|
|
607
|
+
|
|
608
|
+ #if HAS_E0_ENABLE
|
|
609
|
+ #define enable_E0() E0_enable()
|
|
610
|
+ #define disable_E0() E0_disable()
|
|
611
|
+ #else
|
|
612
|
+ #define enable_E0() NOOP
|
|
613
|
+ #define disable_E0() NOOP
|
|
614
|
+ #endif
|
|
615
|
+
|
|
616
|
+ #if E_STEPPERS > 1 && HAS_E1_ENABLE
|
|
617
|
+ #define enable_E1() E1_enable()
|
|
618
|
+ #define disable_E1() E1_disable()
|
|
619
|
+ #else
|
|
620
|
+ #define enable_E1() NOOP
|
|
621
|
+ #define disable_E1() NOOP
|
|
622
|
+ #endif
|
|
623
|
+
|
|
624
|
+ #if E_STEPPERS > 2 && HAS_E2_ENABLE
|
|
625
|
+ #define enable_E2() E2_enable()
|
|
626
|
+ #define disable_E2() E2_disable()
|
|
627
|
+ #else
|
|
628
|
+ #define enable_E2() NOOP
|
|
629
|
+ #define disable_E2() NOOP
|
|
630
|
+ #endif
|
|
631
|
+
|
|
632
|
+ #if E_STEPPERS > 3 && HAS_E3_ENABLE
|
|
633
|
+ #define enable_E3() E3_enable()
|
|
634
|
+ #define disable_E3() E3_disable()
|
|
635
|
+ #else
|
|
636
|
+ #define enable_E3() NOOP
|
|
637
|
+ #define disable_E3() NOOP
|
|
638
|
+ #endif
|
|
639
|
+
|
|
640
|
+ #if E_STEPPERS > 4 && HAS_E4_ENABLE
|
|
641
|
+ #define enable_E4() E4_enable()
|
|
642
|
+ #define disable_E4() E4_disable()
|
|
643
|
+ #else
|
|
644
|
+ #define enable_E4() NOOP
|
|
645
|
+ #define disable_E4() NOOP
|
|
646
|
+ #endif
|
|
647
|
+
|
|
648
|
+ #if E_STEPPERS > 5 && HAS_E5_ENABLE
|
|
649
|
+ #define enable_E5() E5_enable()
|
|
650
|
+ #define disable_E5() E5_disable()
|
|
651
|
+ #else
|
|
652
|
+ #define enable_E5() NOOP
|
|
653
|
+ #define disable_E5() NOOP
|
|
654
|
+ #endif
|
|
655
|
+
|
|
656
|
+#endif // !MIXING_EXTRUDER
|