|
@@ -435,18 +435,100 @@
|
435
|
435
|
/**
|
436
|
436
|
* Shorthand for pin tests, used wherever needed
|
437
|
437
|
*/
|
|
438
|
+
|
|
439
|
+ // Steppers
|
|
440
|
+ #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
|
|
441
|
+ #define HAS_X_DIR (PIN_EXISTS(X_DIR))
|
|
442
|
+ #define HAS_X_STEP (PIN_EXISTS(X_STEP))
|
|
443
|
+ #define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1))
|
|
444
|
+
|
|
445
|
+ #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
|
|
446
|
+ #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
|
|
447
|
+ #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
|
|
448
|
+ #define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1))
|
|
449
|
+
|
|
450
|
+ #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
|
|
451
|
+ #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
|
|
452
|
+ #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
|
|
453
|
+ #define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1))
|
|
454
|
+
|
|
455
|
+ #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
|
|
456
|
+ #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
|
|
457
|
+ #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
|
|
458
|
+
|
|
459
|
+ #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
|
|
460
|
+ #define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
|
|
461
|
+ #define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
|
|
462
|
+
|
|
463
|
+ #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
|
|
464
|
+ #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
|
|
465
|
+ #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
|
|
466
|
+
|
|
467
|
+ // Extruder steppers and solenoids
|
|
468
|
+ #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
|
|
469
|
+ #define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
|
|
470
|
+ #define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
|
|
471
|
+ #define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1))
|
|
472
|
+ #define HAS_SOLENOID_0 (PIN_EXISTS(SOL0))
|
|
473
|
+
|
|
474
|
+ #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
|
|
475
|
+ #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
|
|
476
|
+ #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
|
|
477
|
+ #define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1))
|
|
478
|
+ #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
|
|
479
|
+
|
|
480
|
+ #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
|
|
481
|
+ #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
|
|
482
|
+ #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
|
|
483
|
+ #define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1))
|
|
484
|
+ #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
|
|
485
|
+
|
|
486
|
+ #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
|
|
487
|
+ #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
|
|
488
|
+ #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
|
|
489
|
+ #define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1))
|
|
490
|
+ #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
|
|
491
|
+
|
|
492
|
+ #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE))
|
|
493
|
+ #define HAS_E4_DIR (PIN_EXISTS(E4_DIR))
|
|
494
|
+ #define HAS_E4_STEP (PIN_EXISTS(E4_STEP))
|
|
495
|
+ #define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1))
|
|
496
|
+ #define HAS_SOLENOID_4 (PIN_EXISTS(SOL4))
|
|
497
|
+
|
|
498
|
+ // Endstops and bed probe
|
|
499
|
+ #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X_MIN_PIN))
|
|
500
|
+ #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X_MAX_PIN))
|
|
501
|
+ #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y_MIN_PIN))
|
|
502
|
+ #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y_MAX_PIN))
|
|
503
|
+ #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z_MIN_PIN))
|
|
504
|
+ #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z_MAX_PIN))
|
|
505
|
+ #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
|
|
506
|
+ #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
|
|
507
|
+ #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
|
|
508
|
+
|
|
509
|
+ // Thermistors
|
438
|
510
|
#define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 > -2)
|
439
|
511
|
#define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0 && TEMP_SENSOR_1 > -2)
|
440
|
512
|
#define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0 && TEMP_SENSOR_2 > -2)
|
441
|
513
|
#define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0 && TEMP_SENSOR_3 > -2)
|
442
|
514
|
#define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
|
|
515
|
+ #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
|
443
|
516
|
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
|
|
517
|
+
|
|
518
|
+ // Heaters
|
444
|
519
|
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
|
445
|
520
|
#define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
|
446
|
521
|
#define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
|
447
|
522
|
#define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
|
448
|
523
|
#define HAS_HEATER_4 (PIN_EXISTS(HEATER_4))
|
449
|
524
|
#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
|
|
525
|
+
|
|
526
|
+ // Thermal protection
|
|
527
|
+ #define HAS_THERMALLY_PROTECTED_BED (ENABLED(THERMAL_PROTECTION_BED) && HAS_TEMP_BED && HAS_HEATER_BED)
|
|
528
|
+ #define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0)
|
|
529
|
+ #define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0)
|
|
530
|
+
|
|
531
|
+ // Auto fans
|
450
|
532
|
#define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN))
|
451
|
533
|
#define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN))
|
452
|
534
|
#define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN))
|
|
@@ -463,91 +545,38 @@
|
463
|
545
|
#define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN)
|
464
|
546
|
#define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN)
|
465
|
547
|
#define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN)
|
|
548
|
+
|
|
549
|
+ // Other fans
|
466
|
550
|
#define HAS_FAN0 (PIN_EXISTS(FAN))
|
467
|
551
|
#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN)
|
468
|
552
|
#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN)
|
469
|
553
|
#define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
|
|
554
|
+
|
|
555
|
+ // Servos
|
470
|
556
|
#define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0)
|
471
|
557
|
#define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
|
472
|
558
|
#define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
|
473
|
559
|
#define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
|
474
|
560
|
#define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
|
|
561
|
+
|
|
562
|
+ // Sensors
|
475
|
563
|
#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH))
|
476
|
564
|
#define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT))
|
|
565
|
+
|
|
566
|
+ // User Interface
|
477
|
567
|
#define HAS_HOME (PIN_EXISTS(HOME))
|
478
|
568
|
#define HAS_KILL (PIN_EXISTS(KILL))
|
479
|
569
|
#define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
|
480
|
570
|
#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
|
481
|
|
- #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X_MIN_PIN))
|
482
|
|
- #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X_MAX_PIN))
|
483
|
|
- #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y_MIN_PIN))
|
484
|
|
- #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y_MAX_PIN))
|
485
|
|
- #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z_MIN_PIN))
|
486
|
|
- #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z_MAX_PIN))
|
487
|
|
- #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
|
488
|
|
- #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
|
489
|
|
- #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
|
490
|
|
- #define HAS_SOLENOID_0 (PIN_EXISTS(SOL0))
|
491
|
|
- #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
|
492
|
|
- #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
|
493
|
|
- #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
|
494
|
|
- #define HAS_SOLENOID_4 (PIN_EXISTS(SOL4))
|
495
|
|
- #define HAS_MICROSTEPS_X (PIN_EXISTS(X_MS1))
|
496
|
|
- #define HAS_MICROSTEPS_Y (PIN_EXISTS(Y_MS1))
|
497
|
|
- #define HAS_MICROSTEPS_Z (PIN_EXISTS(Z_MS1))
|
498
|
|
- #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
|
499
|
|
- #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
|
500
|
|
- #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
|
501
|
|
- #define HAS_MICROSTEPS_E3 (PIN_EXISTS(E3_MS1))
|
502
|
|
- #define HAS_MICROSTEPS_E4 (PIN_EXISTS(E4_MS1))
|
503
|
|
- #define HAS_MICROSTEPS (HAS_MICROSTEPS_X || HAS_MICROSTEPS_Y || HAS_MICROSTEPS_Z || HAS_MICROSTEPS_E0 || HAS_MICROSTEPS_E1 || HAS_MICROSTEPS_E2)
|
504
|
|
- #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
|
505
|
|
- #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
|
506
|
|
- #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
|
507
|
|
- #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
|
508
|
|
- #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
|
509
|
|
- #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
|
510
|
|
- #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
|
511
|
|
- #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
|
512
|
|
- #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
|
513
|
|
- #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
|
514
|
|
- #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
|
515
|
|
- #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE))
|
516
|
|
- #define HAS_X_DIR (PIN_EXISTS(X_DIR))
|
517
|
|
- #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
|
518
|
|
- #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
|
519
|
|
- #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
|
520
|
|
- #define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
|
521
|
|
- #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
|
522
|
|
- #define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
|
523
|
|
- #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
|
524
|
|
- #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
|
525
|
|
- #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
|
526
|
|
- #define HAS_E4_DIR (PIN_EXISTS(E4_DIR))
|
527
|
|
- #define HAS_X_STEP (PIN_EXISTS(X_STEP))
|
528
|
|
- #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
|
529
|
|
- #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
|
530
|
|
- #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
|
531
|
|
- #define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
|
532
|
|
- #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
|
533
|
|
- #define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
|
534
|
|
- #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
|
535
|
|
- #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
|
536
|
|
- #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
|
537
|
|
- #define HAS_E4_STEP (PIN_EXISTS(E4_STEP))
|
538
|
|
- #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
|
539
|
571
|
#define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER))
|
540
|
572
|
#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT))
|
541
|
573
|
|
|
574
|
+ // Digital control
|
|
575
|
+ #define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS)
|
|
576
|
+ #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
|
|
577
|
+ #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
|
542
|
578
|
#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
|
543
|
579
|
|
544
|
|
- #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
|
545
|
|
-
|
546
|
|
- #define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED))
|
547
|
|
-
|
548
|
|
- #define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0)
|
549
|
|
- #define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0)
|
550
|
|
-
|
551
|
580
|
/**
|
552
|
581
|
* This setting is also used by M109 when trying to calculate
|
553
|
582
|
* a ballpark safe margin to prevent wait-forever situation.
|