Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix and suffix in debug output #4286

Merged
merged 1 commit into from
Jul 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,22 +573,23 @@ void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P);
static void report_current_position();

#if ENABLED(DEBUG_LEVELING_FEATURE)
void print_xyz(const char* suffix, const float x, const float y, const float z) {
void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) {
serialprintPGM(prefix);
SERIAL_ECHOPAIR("(", x);
SERIAL_ECHOPAIR(", ", y);
SERIAL_ECHOPAIR(", ", z);
SERIAL_ECHOLNPGM(") ");
SERIAL_ECHO(suffix);
SERIAL_ECHOPGM(")");
serialprintPGM(suffix);
}
void print_xyz(const char* suffix, const float xyz[]) {
print_xyz(suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
void print_xyz(const char* prefix,const char* suffix, const float xyz[]) {
print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
}
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
void print_xyz(const char* suffix, const vector_3 &xyz) {
print_xyz(suffix, xyz.x, xyz.y, xyz.z);
void print_xyz(const char* prefix,const char* suffix, const vector_3 &xyz) {
print_xyz(prefix, suffix, xyz.x, xyz.y, xyz.z);
}
#endif
#define DEBUG_POS(PREFIX,VAR) do{ SERIAL_ECHOPGM(PREFIX); print_xyz(" > " STRINGIFY(VAR), VAR); }while(0)
#define DEBUG_POS(SUFFIX,VAR) do{ print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0)
#endif

#if ENABLED(DELTA) || ENABLED(SCARA)
Expand Down Expand Up @@ -1540,6 +1541,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]);
SERIAL_EOL;
DEBUG_POS("", current_position);
}
#endif
Expand Down Expand Up @@ -1653,7 +1655,7 @@ static void clean_up_after_endstop_or_probe_move() {
float old_feedrate = feedrate;

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z);
if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z);
#endif

#if ENABLED(DELTA)
Expand Down Expand Up @@ -4333,7 +4335,7 @@ inline void gcode_M104() {

#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Stop the timer at the end of print, starting is managed by
* Stop the timer at the end of print, starting is managed by
* 'heat and wait' M109.
* We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
* stand by mode, for instance in a dual extruder setup, without affecting
Expand Down Expand Up @@ -4645,7 +4647,7 @@ inline void gcode_M109() {
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (code_value_temp_abs() > BED_MINTEMP) {
/**
* We start the timer when 'heating and waiting' command arrives, LCD
* We start the timer when 'heating and waiting' command arrives, LCD
* functions never wait. Cooling down managed by extruders.
*
* We do not check if the timer is already running because this check will
Expand Down