Преглед на файлове

Simplified E_AXIS_HAS macro

Scott Lahteine преди 4 години
родител
ревизия
9a51f29efa
променени са 2 файла, в които са добавени 2 реда и са изтрити 55 реда
  1. 2
    2
      Marlin/src/core/drivers.h
  2. 0
    53
      Marlin/src/inc/Conditionals_post.h

+ 2
- 2
Marlin/src/core/drivers.h Целия файл

@@ -131,7 +131,7 @@
131 131
 #define AXIS_HAS_UART(A) (    AXIS_DRIVER_TYPE(A,TMC2208) \
132 132
                            || AXIS_DRIVER_TYPE(A,TMC2209) )
133 133
 
134
-#define AXIS_HAS_SW_SERIAL(A) ((AXIS_HAS_UART(A) && !HAS_##A##_HARDWARE_SERIAL))
134
+#define AXIS_HAS_SW_SERIAL(A) ((AXIS_HAS_UART(A) && !defined(A##_HARDWARE_SERIAL)))
135 135
 
136 136
 #define AXIS_HAS_STALLGUARD(A)   (    AXIS_DRIVER_TYPE(A,TMC2130) \
137 137
                                    || AXIS_DRIVER_TYPE(A,TMC2160) \
@@ -158,7 +158,7 @@
158 158
                                    || AXIS_DRIVER_TYPE(A,TMC5160) )
159 159
 
160 160
 #define _OR_EAH(N,T)    || AXIS_HAS_##T(E##N)
161
-#define E_AXIS_HAS(T)   (0 RREPEAT2(E_STEPPERS, _OR_EAH, T))
161
+#define E_AXIS_HAS(T)   (0 _OR_EAH(0,T) _OR_EAH(1,T) _OR_EAH(2,T) _OR_EAH(3,T) _OR_EAH(4,T) _OR_EAH(5,T) _OR_EAH(6,T) _OR_EAH(7,T))
162 162
 
163 163
 #define ANY_AXIS_HAS(T) (    AXIS_HAS_##T(X)  || AXIS_HAS_##T(X2) \
164 164
                           || AXIS_HAS_##T(Y)  || AXIS_HAS_##T(Y2) \

+ 0
- 53
Marlin/src/inc/Conditionals_post.h Целия файл

@@ -1444,59 +1444,6 @@
1444 1444
 #define HAS_Z4_MAX (PIN_EXISTS(Z4_MAX))
1445 1445
 #define HAS_Z_MIN_PROBE_PIN (HAS_CUSTOM_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE))
1446 1446
 
1447
-// Cannot use a macro with a defined() statement inside REPEAT macros.
1448
-// [AXIS]_HARDWARE_SERIAL definitions are typically strings which cannot be
1449
-// tested directly, as they will evaluate to 0.
1450
-#ifdef X_HARDWARE_SERIAL
1451
-  #define HAS_X_HARDWARE_SERIAL 1
1452
-#endif
1453
-#ifdef X2_HARDWARE_SERIAL
1454
-  #define HAS_X2_HARDWARE_SERIAL 1
1455
-#endif
1456
-#ifdef Y_HARDWARE_SERIAL
1457
-  #define HAS_Y_HARDWARE_SERIAL 1
1458
-#endif
1459
-#ifdef Y2_HARDWARE_SERIAL
1460
-  #define HAS_Y2_HARDWARE_SERIAL 1
1461
-#endif
1462
-#ifdef Z_HARDWARE_SERIAL
1463
-  #define HAS_Z_HARDWARE_SERIAL 1
1464
-#endif
1465
-#ifdef Z2_HARDWARE_SERIAL
1466
-  #define HAS_Z2_HARDWARE_SERIAL 1
1467
-#endif
1468
-#ifdef Z3_HARDWARE_SERIAL
1469
-  #define HAS_Z3_HARDWARE_SERIAL 1
1470
-#endif
1471
-#ifdef Z4_HARDWARE_SERIAL
1472
-  #define HAS_Z4_HARDWARE_SERIAL 1
1473
-#endif
1474
-#ifdef E0_HARDWARE_SERIAL
1475
-  #define HAS_E0_HARDWARE_SERIAL 1
1476
-#endif
1477
-#ifdef E1_HARDWARE_SERIAL
1478
-  #define HAS_E1_HARDWARE_SERIAL 1
1479
-#endif
1480
-#ifdef E2_HARDWARE_SERIAL
1481
-  #define HAS_E2_HARDWARE_SERIAL 1
1482
-#endif
1483
-#ifdef E3_HARDWARE_SERIAL
1484
-  #define HAS_E3_HARDWARE_SERIAL 1
1485
-#endif
1486
-#ifdef E4_HARDWARE_SERIAL
1487
-  #define HAS_E4_HARDWARE_SERIAL 1
1488
-#endif
1489
-#ifdef E5_HARDWARE_SERIAL
1490
-  #define HAS_E5_HARDWARE_SERIAL 1
1491
-#endif
1492
-#ifdef E6_HARDWARE_SERIAL
1493
-  #define HAS_E6_HARDWARE_SERIAL 1
1494
-#endif
1495
-#ifdef E7_HARDWARE_SERIAL
1496
-  #define HAS_E7_HARDWARE_SERIAL 1
1497
-#endif
1498
-
1499
-
1500 1447
 //
1501 1448
 // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
1502 1449
 //

Loading…
Отказ
Запис