178
178
#endif
179
179
180
180
#define _EN_ITEM (N ) , E##N
181
+ #define _EN1_ITEM (N ) , E##N:1
181
182
182
- typedef struct { uint16_t NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stepper_current_t ;
183
- typedef struct { uint32_t NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_hybrid_threshold_t ;
184
- typedef struct { int16_t NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } tmc_sgt_t ;
185
- typedef struct { bool NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM ); } tmc_stealth_enabled_t ;
183
+ typedef struct { uint16_t NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t ;
184
+ typedef struct { uint32_t NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t ;
185
+ typedef struct { int16_t NUM_AXIS_LIST (X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t ;
186
+ typedef struct { bool NUM_AXIS_LIST (X: 1 , Y: 1 , Z: 1 , I: 1 , J: 1 , K: 1 , U: 1 , V: 1 , W: 1 ), X2:1 , Y2:1 , Z2:1 , Z3:1 , Z4:1 REPEAT(E_STEPPERS, _EN1_ITEM ); } per_stepper_bool_t ;
186
187
187
188
#undef _EN_ITEM
188
189
@@ -430,10 +431,10 @@ typedef struct SettingsDataStruct {
430
431
//
431
432
// HAS_TRINAMIC_CONFIG
432
433
//
433
- tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
434
- tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
435
- tmc_sgt_t tmc_sgt; // M914 X Y Z X2 Y2 Z2 Z3 Z4
436
- tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
434
+ per_stepper_uint16_t tmc_stepper_current; // M906 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
435
+ per_stepper_uint32_t tmc_hybrid_threshold; // M913 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
436
+ mot_stepper_int16_t tmc_sgt; // M914 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4
437
+ per_stepper_bool_t tmc_stealth_enabled; // M569 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
437
438
438
439
//
439
440
// LIN_ADVANCE
@@ -1220,7 +1221,7 @@ void MarlinSettings::postprocess() {
1220
1221
{
1221
1222
_FIELD_TEST (tmc_stepper_current);
1222
1223
1223
- tmc_stepper_current_t tmc_stepper_current{0 };
1224
+ per_stepper_uint16_t tmc_stepper_current{0 };
1224
1225
1225
1226
#if HAS_TRINAMIC_CONFIG
1226
1227
#if AXIS_IS_TMC(X)
@@ -1300,7 +1301,7 @@ void MarlinSettings::postprocess() {
1300
1301
_FIELD_TEST (tmc_hybrid_threshold);
1301
1302
1302
1303
#if ENABLED(HYBRID_THRESHOLD)
1303
- tmc_hybrid_threshold_t tmc_hybrid_threshold{0 };
1304
+ per_stepper_uint32_t tmc_hybrid_threshold{0 };
1304
1305
TERN_ (X_HAS_STEALTHCHOP, tmc_hybrid_threshold.X = stepperX.get_pwm_thrs ());
1305
1306
TERN_ (Y_HAS_STEALTHCHOP, tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs ());
1306
1307
TERN_ (Z_HAS_STEALTHCHOP, tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs ());
@@ -1325,7 +1326,7 @@ void MarlinSettings::postprocess() {
1325
1326
TERN_ (E7_HAS_STEALTHCHOP, tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs ());
1326
1327
#else
1327
1328
#define _EN_ITEM (N ) , .E##N = 30
1328
- const tmc_hybrid_threshold_t tmc_hybrid_threshold = {
1329
+ const per_stepper_uint32_t tmc_hybrid_threshold = {
1329
1330
NUM_AXIS_LIST (.X = 100 , .Y = 100 , .Z = 3 , .I = 3 , .J = 3 , .K = 3 , .U = 3 , .V = 3 , .W = 3 ),
1330
1331
.X2 = 100 , .Y2 = 100 , .Z2 = 3 , .Z3 = 3 , .Z4 = 3
1331
1332
REPEAT (E_STEPPERS, _EN_ITEM)
@@ -1339,7 +1340,7 @@ void MarlinSettings::postprocess() {
1339
1340
// TMC StallGuard threshold
1340
1341
//
1341
1342
{
1342
- tmc_sgt_t tmc_sgt{0 };
1343
+ mot_stepper_int16_t tmc_sgt{0 };
1343
1344
#if USE_SENSORLESS
1344
1345
NUM_AXIS_CODE (
1345
1346
TERN_ (X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold ()),
@@ -1367,7 +1368,7 @@ void MarlinSettings::postprocess() {
1367
1368
{
1368
1369
_FIELD_TEST (tmc_stealth_enabled);
1369
1370
1370
- tmc_stealth_enabled_t tmc_stealth_enabled = { false };
1371
+ per_stepper_bool_t tmc_stealth_enabled = { false };
1371
1372
TERN_ (X_HAS_STEALTHCHOP, tmc_stealth_enabled.X = stepperX.get_stored_stealthChop ());
1372
1373
TERN_ (Y_HAS_STEALTHCHOP, tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop ());
1373
1374
TERN_ (Z_HAS_STEALTHCHOP, tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop ());
@@ -2168,7 +2169,7 @@ void MarlinSettings::postprocess() {
2168
2169
{
2169
2170
_FIELD_TEST (tmc_stepper_current);
2170
2171
2171
- tmc_stepper_current_t currents;
2172
+ per_stepper_uint16_t currents;
2172
2173
EEPROM_READ (currents);
2173
2174
2174
2175
#if HAS_TRINAMIC_CONFIG
@@ -2247,7 +2248,7 @@ void MarlinSettings::postprocess() {
2247
2248
2248
2249
// TMC Hybrid Threshold
2249
2250
{
2250
- tmc_hybrid_threshold_t tmc_hybrid_threshold;
2251
+ per_stepper_uint32_t tmc_hybrid_threshold;
2251
2252
_FIELD_TEST (tmc_hybrid_threshold);
2252
2253
EEPROM_READ (tmc_hybrid_threshold);
2253
2254
@@ -2283,7 +2284,7 @@ void MarlinSettings::postprocess() {
2283
2284
// TMC StallGuard threshold.
2284
2285
//
2285
2286
{
2286
- tmc_sgt_t tmc_sgt;
2287
+ mot_stepper_int16_t tmc_sgt;
2287
2288
_FIELD_TEST (tmc_sgt);
2288
2289
EEPROM_READ (tmc_sgt);
2289
2290
#if USE_SENSORLESS
@@ -2312,7 +2313,7 @@ void MarlinSettings::postprocess() {
2312
2313
{
2313
2314
_FIELD_TEST (tmc_stealth_enabled);
2314
2315
2315
- tmc_stealth_enabled_t tmc_stealth_enabled;
2316
+ per_stepper_bool_t tmc_stealth_enabled;
2316
2317
EEPROM_READ (tmc_stealth_enabled);
2317
2318
2318
2319
#if HAS_TRINAMIC_CONFIG
0 commit comments