178178#endif
179179
180180#define _EN_ITEM (N ) , E##N
181+ #define _EN1_ITEM (N ) , E##N:1
181182
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 ;
186187
187188#undef _EN_ITEM
188189
@@ -430,10 +431,10 @@ typedef struct SettingsDataStruct {
430431 //
431432 // HAS_TRINAMIC_CONFIG
432433 //
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
437438
438439 //
439440 // LIN_ADVANCE
@@ -1220,7 +1221,7 @@ void MarlinSettings::postprocess() {
12201221 {
12211222 _FIELD_TEST (tmc_stepper_current);
12221223
1223- tmc_stepper_current_t tmc_stepper_current{0 };
1224+ per_stepper_uint16_t tmc_stepper_current{0 };
12241225
12251226 #if HAS_TRINAMIC_CONFIG
12261227 #if AXIS_IS_TMC(X)
@@ -1300,7 +1301,7 @@ void MarlinSettings::postprocess() {
13001301 _FIELD_TEST (tmc_hybrid_threshold);
13011302
13021303 #if ENABLED(HYBRID_THRESHOLD)
1303- tmc_hybrid_threshold_t tmc_hybrid_threshold{0 };
1304+ per_stepper_uint32_t tmc_hybrid_threshold{0 };
13041305 TERN_ (X_HAS_STEALTHCHOP, tmc_hybrid_threshold.X = stepperX.get_pwm_thrs ());
13051306 TERN_ (Y_HAS_STEALTHCHOP, tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs ());
13061307 TERN_ (Z_HAS_STEALTHCHOP, tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs ());
@@ -1325,7 +1326,7 @@ void MarlinSettings::postprocess() {
13251326 TERN_ (E7_HAS_STEALTHCHOP, tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs ());
13261327 #else
13271328 #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 = {
13291330 NUM_AXIS_LIST (.X = 100 , .Y = 100 , .Z = 3 , .I = 3 , .J = 3 , .K = 3 , .U = 3 , .V = 3 , .W = 3 ),
13301331 .X2 = 100 , .Y2 = 100 , .Z2 = 3 , .Z3 = 3 , .Z4 = 3
13311332 REPEAT (E_STEPPERS, _EN_ITEM)
@@ -1339,7 +1340,7 @@ void MarlinSettings::postprocess() {
13391340 // TMC StallGuard threshold
13401341 //
13411342 {
1342- tmc_sgt_t tmc_sgt{0 };
1343+ mot_stepper_int16_t tmc_sgt{0 };
13431344 #if USE_SENSORLESS
13441345 NUM_AXIS_CODE (
13451346 TERN_ (X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold ()),
@@ -1367,7 +1368,7 @@ void MarlinSettings::postprocess() {
13671368 {
13681369 _FIELD_TEST (tmc_stealth_enabled);
13691370
1370- tmc_stealth_enabled_t tmc_stealth_enabled = { false };
1371+ per_stepper_bool_t tmc_stealth_enabled = { false };
13711372 TERN_ (X_HAS_STEALTHCHOP, tmc_stealth_enabled.X = stepperX.get_stored_stealthChop ());
13721373 TERN_ (Y_HAS_STEALTHCHOP, tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop ());
13731374 TERN_ (Z_HAS_STEALTHCHOP, tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop ());
@@ -2168,7 +2169,7 @@ void MarlinSettings::postprocess() {
21682169 {
21692170 _FIELD_TEST (tmc_stepper_current);
21702171
2171- tmc_stepper_current_t currents;
2172+ per_stepper_uint16_t currents;
21722173 EEPROM_READ (currents);
21732174
21742175 #if HAS_TRINAMIC_CONFIG
@@ -2247,7 +2248,7 @@ void MarlinSettings::postprocess() {
22472248
22482249 // TMC Hybrid Threshold
22492250 {
2250- tmc_hybrid_threshold_t tmc_hybrid_threshold;
2251+ per_stepper_uint32_t tmc_hybrid_threshold;
22512252 _FIELD_TEST (tmc_hybrid_threshold);
22522253 EEPROM_READ (tmc_hybrid_threshold);
22532254
@@ -2283,7 +2284,7 @@ void MarlinSettings::postprocess() {
22832284 // TMC StallGuard threshold.
22842285 //
22852286 {
2286- tmc_sgt_t tmc_sgt;
2287+ mot_stepper_int16_t tmc_sgt;
22872288 _FIELD_TEST (tmc_sgt);
22882289 EEPROM_READ (tmc_sgt);
22892290 #if USE_SENSORLESS
@@ -2312,7 +2313,7 @@ void MarlinSettings::postprocess() {
23122313 {
23132314 _FIELD_TEST (tmc_stealth_enabled);
23142315
2315- tmc_stealth_enabled_t tmc_stealth_enabled;
2316+ per_stepper_bool_t tmc_stealth_enabled;
23162317 EEPROM_READ (tmc_stealth_enabled);
23172318
23182319 #if HAS_TRINAMIC_CONFIG
0 commit comments