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 LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stepper_current_t ;
183
- typedef struct { uint32_t LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_hybrid_threshold_t ;
184
- typedef struct { int16_t LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4; } tmc_sgt_t ;
185
- typedef struct { bool LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM ); } tmc_stealth_enabled_t ;
183
+ typedef struct { uint16_t LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t ;
184
+ typedef struct { uint32_t LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t ;
185
+ typedef struct { int16_t LINEAR_AXIS_LIST (X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t ;
186
+ typedef struct { bool LINEAR_AXIS_LIST (X: 1 , Y: 1 , Z: 1 , I: 1 , J: 1 , K: 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...
434
- tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z...
435
- tmc_sgt_t tmc_sgt; // M914 X Y Z...
436
- tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z...
434
+ per_stepper_uint16_t tmc_stepper_current; // M906 X Y Z...
435
+ per_stepper_uint32_t tmc_hybrid_threshold; // M913 X Y Z...
436
+ mot_stepper_int16_t tmc_sgt; // M914 X Y Z...
437
+ per_stepper_bool_t tmc_stealth_enabled; // M569 X Y Z...
437
438
438
439
//
439
440
// LIN_ADVANCE
@@ -1213,7 +1214,7 @@ void MarlinSettings::postprocess() {
1213
1214
{
1214
1215
_FIELD_TEST (tmc_stepper_current);
1215
1216
1216
- tmc_stepper_current_t tmc_stepper_current{0 };
1217
+ per_stepper_uint16_t tmc_stepper_current{0 };
1217
1218
1218
1219
#if HAS_TRINAMIC_CONFIG
1219
1220
#if AXIS_IS_TMC(X)
@@ -1284,7 +1285,7 @@ void MarlinSettings::postprocess() {
1284
1285
_FIELD_TEST (tmc_hybrid_threshold);
1285
1286
1286
1287
#if ENABLED(HYBRID_THRESHOLD)
1287
- tmc_hybrid_threshold_t tmc_hybrid_threshold{0 };
1288
+ per_stepper_uint32_t tmc_hybrid_threshold{0 };
1288
1289
TERN_ (X_HAS_STEALTHCHOP, tmc_hybrid_threshold.X = stepperX.get_pwm_thrs ());
1289
1290
TERN_ (Y_HAS_STEALTHCHOP, tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs ());
1290
1291
TERN_ (Z_HAS_STEALTHCHOP, tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs ());
@@ -1306,7 +1307,7 @@ void MarlinSettings::postprocess() {
1306
1307
TERN_ (E7_HAS_STEALTHCHOP, tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs ());
1307
1308
#else
1308
1309
#define _EN_ITEM (N ) , .E##N = 30
1309
- const tmc_hybrid_threshold_t tmc_hybrid_threshold = {
1310
+ const per_stepper_uint32_t tmc_hybrid_threshold = {
1310
1311
LINEAR_AXIS_LIST (.X = 100 , .Y = 100 , .Z = 3 , .I = 3 , .J = 3 , .K = 3 ),
1311
1312
.X2 = 100 , .Y2 = 100 , .Z2 = 3 , .Z3 = 3 , .Z4 = 3
1312
1313
REPEAT (E_STEPPERS, _EN_ITEM)
@@ -1320,7 +1321,7 @@ void MarlinSettings::postprocess() {
1320
1321
// TMC StallGuard threshold
1321
1322
//
1322
1323
{
1323
- tmc_sgt_t tmc_sgt{0 };
1324
+ mot_stepper_int16_t tmc_sgt{0 };
1324
1325
#if USE_SENSORLESS
1325
1326
LINEAR_AXIS_CODE (
1326
1327
TERN_ (X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold ()),
@@ -1345,7 +1346,7 @@ void MarlinSettings::postprocess() {
1345
1346
{
1346
1347
_FIELD_TEST (tmc_stealth_enabled);
1347
1348
1348
- tmc_stealth_enabled_t tmc_stealth_enabled = { false };
1349
+ per_stepper_bool_t tmc_stealth_enabled = { false };
1349
1350
TERN_ (X_HAS_STEALTHCHOP, tmc_stealth_enabled.X = stepperX.get_stored_stealthChop ());
1350
1351
TERN_ (Y_HAS_STEALTHCHOP, tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop ());
1351
1352
TERN_ (Z_HAS_STEALTHCHOP, tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop ());
@@ -2135,7 +2136,7 @@ void MarlinSettings::postprocess() {
2135
2136
{
2136
2137
_FIELD_TEST (tmc_stepper_current);
2137
2138
2138
- tmc_stepper_current_t currents;
2139
+ per_stepper_uint16_t currents;
2139
2140
EEPROM_READ (currents);
2140
2141
2141
2142
#if HAS_TRINAMIC_CONFIG
@@ -2205,7 +2206,7 @@ void MarlinSettings::postprocess() {
2205
2206
2206
2207
// TMC Hybrid Threshold
2207
2208
{
2208
- tmc_hybrid_threshold_t tmc_hybrid_threshold;
2209
+ per_stepper_uint32_t tmc_hybrid_threshold;
2209
2210
_FIELD_TEST (tmc_hybrid_threshold);
2210
2211
EEPROM_READ (tmc_hybrid_threshold);
2211
2212
@@ -2238,7 +2239,7 @@ void MarlinSettings::postprocess() {
2238
2239
// TMC StallGuard threshold.
2239
2240
//
2240
2241
{
2241
- tmc_sgt_t tmc_sgt;
2242
+ mot_stepper_int16_t tmc_sgt;
2242
2243
_FIELD_TEST (tmc_sgt);
2243
2244
EEPROM_READ (tmc_sgt);
2244
2245
#if USE_SENSORLESS
@@ -2264,7 +2265,7 @@ void MarlinSettings::postprocess() {
2264
2265
{
2265
2266
_FIELD_TEST (tmc_stealth_enabled);
2266
2267
2267
- tmc_stealth_enabled_t tmc_stealth_enabled;
2268
+ per_stepper_bool_t tmc_stealth_enabled;
2268
2269
EEPROM_READ (tmc_stealth_enabled);
2269
2270
2270
2271
#if HAS_TRINAMIC_CONFIG
0 commit comments