diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index d2cbde239..1831c88b6 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -22,6 +22,7 @@ #include "serial.h" #include "language.h" +#include "enum.h" uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; @@ -61,21 +62,15 @@ void print_bin(const uint16_t val) { } } -#if ENABLED(DEBUG_LEVELING_FEATURE) - - #include "enum.h" - - void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) { - serialprintPGM(prefix); - SERIAL_CHAR('('); - SERIAL_ECHO(x); - SERIAL_ECHOPAIR(", ", y, ", ", z); - SERIAL_CHAR(')'); - if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); - } - - void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]) { - print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); - } +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) { + serialprintPGM(prefix); + SERIAL_CHAR('('); + SERIAL_ECHO(x); + SERIAL_ECHOPAIR(", ", y, ", ", z); + SERIAL_CHAR(')'); + if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); +} -#endif +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]) { + print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); +} diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 5764c4c2d..79890dc25 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -180,12 +180,7 @@ void serial_spaces(uint8_t count); void print_bin(const uint16_t val); -#if ENABLED(DEBUG_LEVELING_FEATURE) - void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z); - void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]); - #define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) - #define SERIAL_XYZ(PREFIX,...) do { print_xyz(PSTR(PREFIX), NULL, __VA_ARGS__); } while(0) -#else - #define SERIAL_POS(...) NOOP - #define SERIAL_XYZ(...) NOOP -#endif +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z); +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]); +#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) +#define SERIAL_XYZ(PREFIX,...) do { print_xyz(PSTR(PREFIX), NULL, __VA_ARGS__); } while(0)