Bladeren bron

Fix 'echo:' in TMC parameters M503 report (#15193)

ManuelMcLure 5 jaren geleden
bovenliggende
commit
eed7c2fe2f
1 gewijzigde bestanden met toevoegingen van 37 en 32 verwijderingen
  1. 37
    32
      Marlin/src/module/configuration_store.cpp

+ 37
- 32
Marlin/src/module/configuration_store.cpp Bestand weergeven

@@ -2585,17 +2585,18 @@ void MarlinSettings::reset() {
2585 2585
   #if HAS_TRINAMIC
2586 2586
     inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("  M906"); }
2587 2587
     #if HAS_STEALTHCHOP
2588
-      void say_M569(const char * const etc=nullptr) {
2588
+      void say_M569(const bool forReplay, const char * const etc=nullptr, const bool newLine = false) {
2589
+        CONFIG_ECHO_START();
2589 2590
         SERIAL_ECHOPGM("  M569 S1");
2590 2591
         if (etc) {
2591 2592
           SERIAL_CHAR(' ');
2592 2593
           serialprintPGM(etc);
2593
-          SERIAL_EOL();
2594 2594
         }
2595
+        if (newLine) SERIAL_EOL();
2595 2596
       }
2596 2597
     #endif
2597 2598
     #if ENABLED(HYBRID_THRESHOLD)
2598
-      inline void say_M913() { SERIAL_ECHOPGM("  M913"); }
2599
+      inline void say_M913(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("  M913"); }
2599 2600
     #endif
2600 2601
     #if USE_SENSORLESS
2601 2602
       inline void say_M914() { SERIAL_ECHOPGM("  M914"); }
@@ -3168,9 +3169,8 @@ void MarlinSettings::reset() {
3168 3169
        */
3169 3170
       #if ENABLED(HYBRID_THRESHOLD)
3170 3171
         CONFIG_ECHO_HEADING("Hybrid Threshold:");
3171
-        CONFIG_ECHO_START();
3172 3172
         #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z)
3173
-          say_M913();
3173
+          say_M913(forReplay);
3174 3174
         #endif
3175 3175
         #if AXIS_HAS_STEALTHCHOP(X)
3176 3176
           SERIAL_ECHOPAIR(" X", stepperX.get_pwm_thrs());
@@ -3186,7 +3186,7 @@ void MarlinSettings::reset() {
3186 3186
         #endif
3187 3187
 
3188 3188
         #if AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z2)
3189
-          say_M913();
3189
+          say_M913(forReplay);
3190 3190
           SERIAL_ECHOPGM(" I1");
3191 3191
         #endif
3192 3192
         #if AXIS_HAS_STEALTHCHOP(X2)
@@ -3203,32 +3203,32 @@ void MarlinSettings::reset() {
3203 3203
         #endif
3204 3204
 
3205 3205
         #if AXIS_HAS_STEALTHCHOP(Z3)
3206
-          say_M913();
3206
+          say_M913(forReplay);
3207 3207
           SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.get_pwm_thrs());
3208 3208
         #endif
3209 3209
 
3210 3210
         #if AXIS_HAS_STEALTHCHOP(E0)
3211
-          say_M913();
3211
+          say_M913(forReplay);
3212 3212
           SERIAL_ECHOLNPAIR(" T0 E", stepperE0.get_pwm_thrs());
3213 3213
         #endif
3214 3214
         #if AXIS_HAS_STEALTHCHOP(E1)
3215
-          say_M913();
3215
+          say_M913(forReplay);
3216 3216
           SERIAL_ECHOLNPAIR(" T1 E", stepperE1.get_pwm_thrs());
3217 3217
         #endif
3218 3218
         #if AXIS_HAS_STEALTHCHOP(E2)
3219
-          say_M913();
3219
+          say_M913(forReplay);
3220 3220
           SERIAL_ECHOLNPAIR(" T2 E", stepperE2.get_pwm_thrs());
3221 3221
         #endif
3222 3222
         #if AXIS_HAS_STEALTHCHOP(E3)
3223
-          say_M913();
3223
+          say_M913(forReplay);
3224 3224
           SERIAL_ECHOLNPAIR(" T3 E", stepperE3.get_pwm_thrs());
3225 3225
         #endif
3226 3226
         #if AXIS_HAS_STEALTHCHOP(E4)
3227
-          say_M913();
3227
+          say_M913(forReplay);
3228 3228
           SERIAL_ECHOLNPAIR(" T4 E", stepperE4.get_pwm_thrs());
3229 3229
         #endif
3230 3230
         #if AXIS_HAS_STEALTHCHOP(E5)
3231
-          say_M913();
3231
+          say_M913(forReplay);
3232 3232
           SERIAL_ECHOLNPAIR(" T5 E", stepperE5.get_pwm_thrs());
3233 3233
         #endif
3234 3234
         SERIAL_EOL();
@@ -3239,8 +3239,8 @@ void MarlinSettings::reset() {
3239 3239
        */
3240 3240
       #if USE_SENSORLESS
3241 3241
         CONFIG_ECHO_HEADING("StallGuard threshold:");
3242
-        CONFIG_ECHO_START();
3243 3242
         #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
3243
+          CONFIG_ECHO_START();
3244 3244
           say_M914();
3245 3245
           #if X_SENSORLESS
3246 3246
             SERIAL_ECHOPAIR(" X", stepperX.homing_threshold());
@@ -3259,6 +3259,7 @@ void MarlinSettings::reset() {
3259 3259
         #define HAS_Z2_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2))
3260 3260
         #define HAS_Z3_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3))
3261 3261
         #if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS
3262
+          CONFIG_ECHO_START();
3262 3263
           say_M914();
3263 3264
           SERIAL_ECHOPGM(" I1");
3264 3265
           #if HAS_X2_SENSORLESS
@@ -3274,6 +3275,7 @@ void MarlinSettings::reset() {
3274 3275
         #endif
3275 3276
 
3276 3277
         #if HAS_Z3_SENSORLESS
3278
+          CONFIG_ECHO_START();
3277 3279
           say_M914();
3278 3280
           SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold());
3279 3281
         #endif
@@ -3285,7 +3287,6 @@ void MarlinSettings::reset() {
3285 3287
        */
3286 3288
       #if HAS_STEALTHCHOP
3287 3289
         CONFIG_ECHO_HEADING("Driver stepping mode:");
3288
-        CONFIG_ECHO_START();
3289 3290
         #if AXIS_HAS_STEALTHCHOP(X)
3290 3291
           const bool chop_x = stepperX.get_stealthChop_status();
3291 3292
         #else
@@ -3302,11 +3303,13 @@ void MarlinSettings::reset() {
3302 3303
           constexpr bool chop_z = false;
3303 3304
         #endif
3304 3305
 
3305
-        if (chop_x || chop_y || chop_z) say_M569();
3306
-        if (chop_x) SERIAL_ECHOPGM(" X");
3307
-        if (chop_y) SERIAL_ECHOPGM(" Y");
3308
-        if (chop_z) SERIAL_ECHOPGM(" Z");
3309
-        if (chop_x || chop_y || chop_z) SERIAL_EOL();
3306
+        if (chop_x || chop_y || chop_z) {
3307
+          say_M569(forReplay);
3308
+          if (chop_x) SERIAL_ECHOPGM(" X");
3309
+          if (chop_y) SERIAL_ECHOPGM(" Y");
3310
+          if (chop_z) SERIAL_ECHOPGM(" Z");
3311
+          SERIAL_EOL();
3312
+        }
3310 3313
 
3311 3314
         #if AXIS_HAS_STEALTHCHOP(X2)
3312 3315
           const bool chop_x2 = stepperX2.get_stealthChop_status();
@@ -3324,33 +3327,35 @@ void MarlinSettings::reset() {
3324 3327
           constexpr bool chop_z2 = false;
3325 3328
         #endif
3326 3329
 
3327
-        if (chop_x2 || chop_y2 || chop_z2) say_M569(PSTR("I1"));
3328
-        if (chop_x2) SERIAL_ECHOPGM(" X");
3329
-        if (chop_y2) SERIAL_ECHOPGM(" Y");
3330
-        if (chop_z2) SERIAL_ECHOPGM(" Z");
3331
-        if (chop_x2 || chop_y2 || chop_z2) SERIAL_EOL();
3330
+        if (chop_x2 || chop_y2 || chop_z2) {
3331
+          say_M569(forReplay, PSTR("I1"));
3332
+          if (chop_x2) SERIAL_ECHOPGM(" X");
3333
+          if (chop_y2) SERIAL_ECHOPGM(" Y");
3334
+          if (chop_z2) SERIAL_ECHOPGM(" Z");
3335
+          SERIAL_EOL();
3336
+        }
3332 3337
 
3333 3338
         #if AXIS_HAS_STEALTHCHOP(Z3)
3334
-          if (stepperZ3.get_stealthChop_status()) { say_M569(PSTR("I2 Z")); }
3339
+          if (stepperZ3.get_stealthChop_status()) { say_M569(forReplay, PSTR("I2 Z"), true); }
3335 3340
         #endif
3336 3341
 
3337 3342
         #if AXIS_HAS_STEALTHCHOP(E0)
3338
-          if (stepperE0.get_stealthChop_status()) { say_M569(PSTR("T0 E")); }
3343
+          if (stepperE0.get_stealthChop_status()) { say_M569(forReplay, PSTR("T0 E"), true); }
3339 3344
         #endif
3340 3345
         #if AXIS_HAS_STEALTHCHOP(E1)
3341
-          if (stepperE1.get_stealthChop_status()) { say_M569(PSTR("T1 E")); }
3346
+          if (stepperE1.get_stealthChop_status()) { say_M569(forReplay, PSTR("T1 E"), true); }
3342 3347
         #endif
3343 3348
         #if AXIS_HAS_STEALTHCHOP(E2)
3344
-          if (stepperE2.get_stealthChop_status()) { say_M569(PSTR("T2 E")); }
3349
+          if (stepperE2.get_stealthChop_status()) { say_M569(forReplay, PSTR("T2 E"), true); }
3345 3350
         #endif
3346 3351
         #if AXIS_HAS_STEALTHCHOP(E3)
3347
-          if (stepperE3.get_stealthChop_status()) { say_M569(PSTR("T3 E")); }
3352
+          if (stepperE3.get_stealthChop_status()) { say_M569(forReplay, PSTR("T3 E"), true); }
3348 3353
         #endif
3349 3354
         #if AXIS_HAS_STEALTHCHOP(E4)
3350
-          if (stepperE4.get_stealthChop_status()) { say_M569(PSTR("T4 E")); }
3355
+          if (stepperE4.get_stealthChop_status()) { say_M569(forReplay, PSTR("T4 E"), true); }
3351 3356
         #endif
3352 3357
         #if AXIS_HAS_STEALTHCHOP(E5)
3353
-          if (stepperE5.get_stealthChop_status()) { say_M569(PSTR("T5 E")); }
3358
+          if (stepperE5.get_stealthChop_status()) { say_M569(forReplay, PSTR("T5 E"), true); }
3354 3359
         #endif
3355 3360
 
3356 3361
       #endif // HAS_STEALTHCHOP

Laden…
Annuleren
Opslaan