Browse Source

More serial macro cleanup

Scott Lahteine 5 years ago
parent
commit
cb7817093f
3 changed files with 29 additions and 50 deletions
  1. 0
    6
      Marlin/src/core/debug_out.h
  2. 3
    4
      Marlin/src/core/serial.h
  3. 26
    40
      Marlin/src/module/configuration_store.cpp

+ 0
- 6
Marlin/src/core/debug_out.h View File

35
 #undef DEBUG_ECHO_F
35
 #undef DEBUG_ECHO_F
36
 #undef DEBUG_ECHOLN
36
 #undef DEBUG_ECHOLN
37
 #undef DEBUG_ECHOPGM
37
 #undef DEBUG_ECHOPGM
38
-#undef DEBUG_ECHOPGM_P
39
 #undef DEBUG_ECHOLNPGM
38
 #undef DEBUG_ECHOLNPGM
40
-#undef DEBUG_ECHOLNPGM_P
41
 #undef DEBUG_ECHOPAIR
39
 #undef DEBUG_ECHOPAIR
42
 #undef DEBUG_ECHOPAIR_P
40
 #undef DEBUG_ECHOPAIR_P
43
 #undef DEBUG_ECHOPAIR_F
41
 #undef DEBUG_ECHOPAIR_F
62
   #define DEBUG_ECHO_F            SERIAL_ECHO_F
60
   #define DEBUG_ECHO_F            SERIAL_ECHO_F
63
   #define DEBUG_ECHOLN            SERIAL_ECHOLN
61
   #define DEBUG_ECHOLN            SERIAL_ECHOLN
64
   #define DEBUG_ECHOPGM           SERIAL_ECHOPGM
62
   #define DEBUG_ECHOPGM           SERIAL_ECHOPGM
65
-  #define DEBUG_ECHOPGM_P         SERIAL_ECHOPGM_P
66
   #define DEBUG_ECHOLNPGM         SERIAL_ECHOLNPGM
63
   #define DEBUG_ECHOLNPGM         SERIAL_ECHOLNPGM
67
-  #define DEBUG_ECHOLNPGM_P       SERIAL_ECHOLNPGM_P
68
   #define DEBUG_ECHOPAIR          SERIAL_ECHOPAIR
64
   #define DEBUG_ECHOPAIR          SERIAL_ECHOPAIR
69
   #define DEBUG_ECHOPAIR_P        SERIAL_ECHOPAIR_P
65
   #define DEBUG_ECHOPAIR_P        SERIAL_ECHOPAIR_P
70
   #define DEBUG_ECHOPAIR_F        SERIAL_ECHOPAIR_F
66
   #define DEBUG_ECHOPAIR_F        SERIAL_ECHOPAIR_F
88
   #define DEBUG_ECHO_F(...)         NOOP
84
   #define DEBUG_ECHO_F(...)         NOOP
89
   #define DEBUG_ECHOLN(...)         NOOP
85
   #define DEBUG_ECHOLN(...)         NOOP
90
   #define DEBUG_ECHOPGM(...)        NOOP
86
   #define DEBUG_ECHOPGM(...)        NOOP
91
-  #define DEBUG_ECHOPGM_P(...)      NOOP
92
   #define DEBUG_ECHOLNPGM(...)      NOOP
87
   #define DEBUG_ECHOLNPGM(...)      NOOP
93
-  #define DEBUG_ECHOLNPGM_P(...)    NOOP
94
   #define DEBUG_ECHOPAIR(...)       NOOP
88
   #define DEBUG_ECHOPAIR(...)       NOOP
95
   #define DEBUG_ECHOPAIR_P(...)     NOOP
89
   #define DEBUG_ECHOPAIR_P(...)     NOOP
96
   #define DEBUG_ECHOPAIR_F(...)     NOOP
90
   #define DEBUG_ECHOPAIR_F(...)     NOOP

+ 3
- 4
Marlin/src/core/serial.h View File

230
 #define SERIAL_ECHOLIST(pre,V...)   do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
230
 #define SERIAL_ECHOLIST(pre,V...)   do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
231
 #define SERIAL_ECHOLIST_N(N,V...)   _SLST_N(N,LIST_N(N,V))
231
 #define SERIAL_ECHOLIST_N(N,V...)   _SLST_N(N,LIST_N(N,V))
232
 
232
 
233
-#define SERIAL_ECHOPGM_P(P)         (serialprintPGM(P))
234
-#define SERIAL_ECHOLNPGM_P(P)       (serialprintPGM(P "\n"))
233
+#define SERIAL_ECHO_P(P)            (serialprintPGM(P))
235
 
234
 
236
-#define SERIAL_ECHOPGM(S)           (serialprintPGM(PSTR(S)))
237
-#define SERIAL_ECHOLNPGM(S)         (serialprintPGM(PSTR(S "\n")))
235
+#define SERIAL_ECHOPGM(S)           (SERIAL_ECHO_P(PSTR(S)))
236
+#define SERIAL_ECHOLNPGM(S)         (SERIAL_ECHO_P(PSTR(S "\n")))
238
 
237
 
239
 #define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
238
 #define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
240
 #define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)
239
 #define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)

+ 26
- 40
Marlin/src/module/configuration_store.cpp View File

3124
 
3124
 
3125
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
3125
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
3126
         say_M906(forReplay);
3126
         say_M906(forReplay);
3127
-        SERIAL_ECHOLNPAIR_P(
3128
-          #if AXIS_IS_TMC(X)
3129
-            SP_X_STR, stepperX.getMilliamps()
3130
-          #endif
3131
-          #if AXIS_IS_TMC(Y)
3132
-            #if AXIS_IS_TMC(X)
3133
-              ,
3134
-            #endif
3135
-            SP_Y_STR, stepperY.getMilliamps()
3136
-          #endif
3137
-          #if AXIS_IS_TMC(Z)
3138
-            #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y)
3139
-              ,
3140
-            #endif
3141
-            SP_Z_STR, stepperZ.getMilliamps()
3142
-          #endif
3143
-        );
3127
+        #if AXIS_IS_TMC(X)
3128
+          SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps());
3129
+        #endif
3130
+        #if AXIS_IS_TMC(Y)
3131
+          SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps());
3132
+        #endif
3133
+        #if AXIS_IS_TMC(Z)
3134
+          SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps());
3135
+        #endif
3136
+        SERIAL_EOL();
3144
       #endif
3137
       #endif
3145
 
3138
 
3146
       #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
3139
       #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
3147
         say_M906(forReplay);
3140
         say_M906(forReplay);
3148
         SERIAL_ECHOPGM(" I1");
3141
         SERIAL_ECHOPGM(" I1");
3149
-        SERIAL_ECHOLNPAIR_P(
3150
-          #if AXIS_IS_TMC(X2)
3151
-            SP_X_STR, stepperX2.getMilliamps()
3152
-          #endif
3153
-          #if AXIS_IS_TMC(Y2)
3154
-            #if AXIS_IS_TMC(X2)
3155
-              ,
3156
-            #endif
3157
-            SP_Y_STR, stepperY2.getMilliamps()
3158
-          #endif
3159
-          #if AXIS_IS_TMC(Z2)
3160
-            #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2)
3161
-              ,
3162
-            #endif
3163
-            SP_Z_STR, stepperZ2.getMilliamps()
3164
-          #endif
3165
-        );
3142
+        #if AXIS_IS_TMC(X2)
3143
+          SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps());
3144
+        #endif
3145
+        #if AXIS_IS_TMC(Y2)
3146
+          SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps());
3147
+        #endif
3148
+        #if AXIS_IS_TMC(Z2)
3149
+          SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps());
3150
+        #endif
3151
+        SERIAL_EOL();
3166
       #endif
3152
       #endif
3167
 
3153
 
3168
       #if AXIS_IS_TMC(Z3)
3154
       #if AXIS_IS_TMC(Z3)
3333
 
3319
 
3334
         if (chop_x || chop_y || chop_z) {
3320
         if (chop_x || chop_y || chop_z) {
3335
           say_M569(forReplay);
3321
           say_M569(forReplay);
3336
-          if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR);
3337
-          if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR);
3338
-          if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR);
3322
+          if (chop_x) SERIAL_ECHO_P(SP_X_STR);
3323
+          if (chop_y) SERIAL_ECHO_P(SP_Y_STR);
3324
+          if (chop_z) SERIAL_ECHO_P(SP_Z_STR);
3339
           SERIAL_EOL();
3325
           SERIAL_EOL();
3340
         }
3326
         }
3341
 
3327
 
3357
 
3343
 
3358
         if (chop_x2 || chop_y2 || chop_z2) {
3344
         if (chop_x2 || chop_y2 || chop_z2) {
3359
           say_M569(forReplay, PSTR("I1"));
3345
           say_M569(forReplay, PSTR("I1"));
3360
-          if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
3361
-          if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
3362
-          if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
3346
+          if (chop_x2) SERIAL_ECHO_P(SP_X_STR);
3347
+          if (chop_y2) SERIAL_ECHO_P(SP_Y_STR);
3348
+          if (chop_z2) SERIAL_ECHO_P(SP_Z_STR);
3363
           SERIAL_EOL();
3349
           SERIAL_EOL();
3364
         }
3350
         }
3365
 
3351
 

Loading…
Cancel
Save