More serial macro cleanup

This commit is contained in:
Scott Lahteine 2019-12-01 22:23:19 -06:00
parent 9114a14eca
commit cb7817093f
3 changed files with 29 additions and 50 deletions

View file

@ -35,9 +35,7 @@
#undef DEBUG_ECHO_F #undef DEBUG_ECHO_F
#undef DEBUG_ECHOLN #undef DEBUG_ECHOLN
#undef DEBUG_ECHOPGM #undef DEBUG_ECHOPGM
#undef DEBUG_ECHOPGM_P
#undef DEBUG_ECHOLNPGM #undef DEBUG_ECHOLNPGM
#undef DEBUG_ECHOLNPGM_P
#undef DEBUG_ECHOPAIR #undef DEBUG_ECHOPAIR
#undef DEBUG_ECHOPAIR_P #undef DEBUG_ECHOPAIR_P
#undef DEBUG_ECHOPAIR_F #undef DEBUG_ECHOPAIR_F
@ -62,9 +60,7 @@
#define DEBUG_ECHO_F SERIAL_ECHO_F #define DEBUG_ECHO_F SERIAL_ECHO_F
#define DEBUG_ECHOLN SERIAL_ECHOLN #define DEBUG_ECHOLN SERIAL_ECHOLN
#define DEBUG_ECHOPGM SERIAL_ECHOPGM #define DEBUG_ECHOPGM SERIAL_ECHOPGM
#define DEBUG_ECHOPGM_P SERIAL_ECHOPGM_P
#define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM #define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM
#define DEBUG_ECHOLNPGM_P SERIAL_ECHOLNPGM_P
#define DEBUG_ECHOPAIR SERIAL_ECHOPAIR #define DEBUG_ECHOPAIR SERIAL_ECHOPAIR
#define DEBUG_ECHOPAIR_P SERIAL_ECHOPAIR_P #define DEBUG_ECHOPAIR_P SERIAL_ECHOPAIR_P
#define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F #define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F
@ -88,9 +84,7 @@
#define DEBUG_ECHO_F(...) NOOP #define DEBUG_ECHO_F(...) NOOP
#define DEBUG_ECHOLN(...) NOOP #define DEBUG_ECHOLN(...) NOOP
#define DEBUG_ECHOPGM(...) NOOP #define DEBUG_ECHOPGM(...) NOOP
#define DEBUG_ECHOPGM_P(...) NOOP
#define DEBUG_ECHOLNPGM(...) NOOP #define DEBUG_ECHOLNPGM(...) NOOP
#define DEBUG_ECHOLNPGM_P(...) NOOP
#define DEBUG_ECHOPAIR(...) NOOP #define DEBUG_ECHOPAIR(...) NOOP
#define DEBUG_ECHOPAIR_P(...) NOOP #define DEBUG_ECHOPAIR_P(...) NOOP
#define DEBUG_ECHOPAIR_F(...) NOOP #define DEBUG_ECHOPAIR_F(...) NOOP

View file

@ -230,11 +230,10 @@ extern uint8_t marlin_debug_flags;
#define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0) #define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
#define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V)) #define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V))
#define SERIAL_ECHOPGM_P(P) (serialprintPGM(P)) #define SERIAL_ECHO_P(P) (serialprintPGM(P))
#define SERIAL_ECHOLNPGM_P(P) (serialprintPGM(P "\n"))
#define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S))) #define SERIAL_ECHOPGM(S) (SERIAL_ECHO_P(PSTR(S)))
#define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n"))) #define SERIAL_ECHOLNPGM(S) (SERIAL_ECHO_P(PSTR(S "\n")))
#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0) #define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0) #define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)

View file

@ -3124,45 +3124,31 @@ void MarlinSettings::reset() {
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
say_M906(forReplay); say_M906(forReplay);
SERIAL_ECHOLNPAIR_P( #if AXIS_IS_TMC(X)
#if AXIS_IS_TMC(X) SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps());
SP_X_STR, stepperX.getMilliamps() #endif
#endif #if AXIS_IS_TMC(Y)
#if AXIS_IS_TMC(Y) SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps());
#if AXIS_IS_TMC(X) #endif
, #if AXIS_IS_TMC(Z)
#endif SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps());
SP_Y_STR, stepperY.getMilliamps() #endif
#endif SERIAL_EOL();
#if AXIS_IS_TMC(Z)
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y)
,
#endif
SP_Z_STR, stepperZ.getMilliamps()
#endif
);
#endif #endif
#if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
say_M906(forReplay); say_M906(forReplay);
SERIAL_ECHOPGM(" I1"); SERIAL_ECHOPGM(" I1");
SERIAL_ECHOLNPAIR_P( #if AXIS_IS_TMC(X2)
#if AXIS_IS_TMC(X2) SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps());
SP_X_STR, stepperX2.getMilliamps() #endif
#endif #if AXIS_IS_TMC(Y2)
#if AXIS_IS_TMC(Y2) SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps());
#if AXIS_IS_TMC(X2) #endif
, #if AXIS_IS_TMC(Z2)
#endif SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps());
SP_Y_STR, stepperY2.getMilliamps() #endif
#endif SERIAL_EOL();
#if AXIS_IS_TMC(Z2)
#if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2)
,
#endif
SP_Z_STR, stepperZ2.getMilliamps()
#endif
);
#endif #endif
#if AXIS_IS_TMC(Z3) #if AXIS_IS_TMC(Z3)
@ -3333,9 +3319,9 @@ void MarlinSettings::reset() {
if (chop_x || chop_y || chop_z) { if (chop_x || chop_y || chop_z) {
say_M569(forReplay); say_M569(forReplay);
if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR); if (chop_x) SERIAL_ECHO_P(SP_X_STR);
if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR); if (chop_y) SERIAL_ECHO_P(SP_Y_STR);
if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR); if (chop_z) SERIAL_ECHO_P(SP_Z_STR);
SERIAL_EOL(); SERIAL_EOL();
} }
@ -3357,9 +3343,9 @@ void MarlinSettings::reset() {
if (chop_x2 || chop_y2 || chop_z2) { if (chop_x2 || chop_y2 || chop_z2) {
say_M569(forReplay, PSTR("I1")); say_M569(forReplay, PSTR("I1"));
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR); if (chop_x2) SERIAL_ECHO_P(SP_X_STR);
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR); if (chop_y2) SERIAL_ECHO_P(SP_Y_STR);
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR); if (chop_z2) SERIAL_ECHO_P(SP_Z_STR);
SERIAL_EOL(); SERIAL_EOL();
} }