Expand on serial debugging (#13577)
This commit is contained in:
parent
bf7b28b456
commit
cf12fc8366
20 changed files with 93 additions and 271 deletions
|
@ -58,54 +58,10 @@
|
|||
|
||||
void unified_bed_leveling::report_state() {
|
||||
echo_name();
|
||||
SERIAL_ECHOPGM(" System v" UBL_VERSION " ");
|
||||
if (!planner.leveling_active) SERIAL_ECHOPGM("in");
|
||||
SERIAL_ECHOLNPGM("active.");
|
||||
serial_ternary(planner.leveling_active, PSTR(" System v" UBL_VERSION " "), PSTR(""), PSTR("in"), PSTR("active\n"));
|
||||
serial_delay(50);
|
||||
}
|
||||
|
||||
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
||||
|
||||
static void debug_echo_axis(const AxisEnum axis) {
|
||||
if (current_position[axis] == destination[axis])
|
||||
SERIAL_ECHOPGM("-------------");
|
||||
else
|
||||
SERIAL_ECHO_F(destination[X_AXIS], 6);
|
||||
}
|
||||
|
||||
void debug_current_and_destination(PGM_P title) {
|
||||
|
||||
// if the title message starts with a '!' it is so important, we are going to
|
||||
// ignore the status of the g26_debug_flag
|
||||
if (*title != '!' && !g26_debug_flag) return;
|
||||
|
||||
const float de = destination[E_AXIS] - current_position[E_AXIS];
|
||||
|
||||
if (de == 0.0) return; // Printing moves only
|
||||
|
||||
const float dx = destination[X_AXIS] - current_position[X_AXIS],
|
||||
dy = destination[Y_AXIS] - current_position[Y_AXIS],
|
||||
xy_dist = HYPOT(dx, dy);
|
||||
|
||||
if (xy_dist == 0.0) return;
|
||||
|
||||
const float fpmm = de / xy_dist;
|
||||
SERIAL_ECHOPAIR_F(" fpmm=", fpmm, 6);
|
||||
SERIAL_ECHOPAIR_F(" current=( ", current_position[X_AXIS], 6);
|
||||
SERIAL_ECHOPAIR_F(", ", current_position[Y_AXIS], 6);
|
||||
SERIAL_ECHOPAIR_F(", ", current_position[Z_AXIS], 6);
|
||||
SERIAL_ECHOPAIR_F(", ", current_position[E_AXIS], 6);
|
||||
SERIAL_ECHOPGM(" ) destination=( "); debug_echo_axis(X_AXIS);
|
||||
SERIAL_ECHOPGM(", "); debug_echo_axis(Y_AXIS);
|
||||
SERIAL_ECHOPGM(", "); debug_echo_axis(Z_AXIS);
|
||||
SERIAL_ECHOPGM(", "); debug_echo_axis(E_AXIS);
|
||||
SERIAL_ECHOPGM(" ) ");
|
||||
serialprintPGM(title);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
#endif // UBL_DEVEL_DEBUGGING
|
||||
|
||||
int8_t unified_bed_leveling::storage_slot;
|
||||
|
||||
float unified_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue