@@ -1359,9 +1359,7 @@ void prepare_line_to_destination() {
1359
1359
#if X_SENSORLESS
1360
1360
case X_AXIS:
1361
1361
stealth_states.x = tmc_enable_stallguard (stepperX);
1362
- #if AXIS_HAS_STALLGUARD(X2)
1363
- stealth_states.x2 = tmc_enable_stallguard (stepperX2);
1364
- #endif
1362
+ TERN_ (X2_SENSORLESS, stealth_states.x2 = tmc_enable_stallguard (stepperX2));
1365
1363
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SENSORLESS
1366
1364
stealth_states.y = tmc_enable_stallguard (stepperY);
1367
1365
#elif CORE_IS_XZ && Z_SENSORLESS
@@ -1372,9 +1370,7 @@ void prepare_line_to_destination() {
1372
1370
#if Y_SENSORLESS
1373
1371
case Y_AXIS:
1374
1372
stealth_states.y = tmc_enable_stallguard (stepperY);
1375
- #if AXIS_HAS_STALLGUARD(Y2)
1376
- stealth_states.y2 = tmc_enable_stallguard (stepperY2);
1377
- #endif
1373
+ TERN_ (Y2_SENSORLESS, stealth_states.y2 = tmc_enable_stallguard (stepperY2));
1378
1374
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS
1379
1375
stealth_states.x = tmc_enable_stallguard (stepperX);
1380
1376
#elif CORE_IS_YZ && Z_SENSORLESS
@@ -1385,15 +1381,9 @@ void prepare_line_to_destination() {
1385
1381
#if Z_SENSORLESS
1386
1382
case Z_AXIS:
1387
1383
stealth_states.z = tmc_enable_stallguard (stepperZ);
1388
- #if AXIS_HAS_STALLGUARD(Z2)
1389
- stealth_states.z2 = tmc_enable_stallguard (stepperZ2);
1390
- #endif
1391
- #if AXIS_HAS_STALLGUARD(Z3)
1392
- stealth_states.z3 = tmc_enable_stallguard (stepperZ3);
1393
- #endif
1394
- #if AXIS_HAS_STALLGUARD(Z4)
1395
- stealth_states.z4 = tmc_enable_stallguard (stepperZ4);
1396
- #endif
1384
+ TERN_ (Z2_SENSORLESS, stealth_states.z2 = tmc_enable_stallguard (stepperZ2));
1385
+ TERN_ (Z3_SENSORLESS, stealth_states.z3 = tmc_enable_stallguard (stepperZ3));
1386
+ TERN_ (Z4_SENSORLESS, stealth_states.z4 = tmc_enable_stallguard (stepperZ4));
1397
1387
#if CORE_IS_XZ && X_SENSORLESS
1398
1388
stealth_states.x = tmc_enable_stallguard (stepperX);
1399
1389
#elif CORE_IS_YZ && Y_SENSORLESS
@@ -1445,9 +1435,7 @@ void prepare_line_to_destination() {
1445
1435
#if X_SENSORLESS
1446
1436
case X_AXIS:
1447
1437
tmc_disable_stallguard (stepperX, enable_stealth.x );
1448
- #if AXIS_HAS_STALLGUARD(X2)
1449
- tmc_disable_stallguard (stepperX2, enable_stealth.x2 );
1450
- #endif
1438
+ TERN_ (X2_SENSORLESS, tmc_disable_stallguard (stepperX2, enable_stealth.x2 ));
1451
1439
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SENSORLESS
1452
1440
tmc_disable_stallguard (stepperY, enable_stealth.y );
1453
1441
#elif CORE_IS_XZ && Z_SENSORLESS
@@ -1458,9 +1446,7 @@ void prepare_line_to_destination() {
1458
1446
#if Y_SENSORLESS
1459
1447
case Y_AXIS:
1460
1448
tmc_disable_stallguard (stepperY, enable_stealth.y );
1461
- #if AXIS_HAS_STALLGUARD(Y2)
1462
- tmc_disable_stallguard (stepperY2, enable_stealth.y2 );
1463
- #endif
1449
+ TERN_ (Y2_SENSORLESS, tmc_disable_stallguard (stepperY2, enable_stealth.y2 ));
1464
1450
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS
1465
1451
tmc_disable_stallguard (stepperX, enable_stealth.x );
1466
1452
#elif CORE_IS_YZ && Z_SENSORLESS
@@ -1471,15 +1457,9 @@ void prepare_line_to_destination() {
1471
1457
#if Z_SENSORLESS
1472
1458
case Z_AXIS:
1473
1459
tmc_disable_stallguard (stepperZ, enable_stealth.z );
1474
- #if AXIS_HAS_STALLGUARD(Z2)
1475
- tmc_disable_stallguard (stepperZ2, enable_stealth.z2 );
1476
- #endif
1477
- #if AXIS_HAS_STALLGUARD(Z3)
1478
- tmc_disable_stallguard (stepperZ3, enable_stealth.z3 );
1479
- #endif
1480
- #if AXIS_HAS_STALLGUARD(Z4)
1481
- tmc_disable_stallguard (stepperZ4, enable_stealth.z4 );
1482
- #endif
1460
+ TERN_ (Z2_SENSORLESS, tmc_disable_stallguard (stepperZ2, enable_stealth.z2 ));
1461
+ TERN_ (Z3_SENSORLESS, tmc_disable_stallguard (stepperZ3, enable_stealth.z3 ));
1462
+ TERN_ (Z4_SENSORLESS, tmc_disable_stallguard (stepperZ4, enable_stealth.z4 ));
1483
1463
#if CORE_IS_XZ && X_SENSORLESS
1484
1464
tmc_disable_stallguard (stepperX, enable_stealth.x );
1485
1465
#elif CORE_IS_YZ && Y_SENSORLESS
0 commit comments