🎨 Fewer serial macros

This commit is contained in:
Scott Lahteine
2021-09-09 04:57:05 -05:00
committed by Scott Lahteine
parent 6d96c221bd
commit b661795ae5
159 changed files with 1002 additions and 1014 deletions

View File

@ -111,7 +111,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
* If true, move to MAX_X and release the solenoid
*/
static void dock_sled(const bool stow) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("dock_sled(", stow, ")");
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("dock_sled(", stow, ")");
// Dock sled a bit closer to ensure proper capturing
do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0));
@ -274,7 +274,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
* Raise Z to a minimum height to make room for a probe to move
*/
void Probe::do_z_raise(const float z_raise) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probe::do_z_raise(", z_raise, ")");
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Probe::do_z_raise(", z_raise, ")");
float z_dest = z_raise;
if (offset.z < 0) z_dest -= offset.z;
do_z_clearance(z_dest);
@ -367,7 +367,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
#if ENABLED(WAIT_FOR_NOZZLE_HEAT)
const celsius_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0;
if (hotendPreheat) {
DEBUG_ECHOPAIR("hotend (", hotendPreheat, ")");
DEBUG_ECHOPGM("hotend (", hotendPreheat, ")");
thermalManager.setTargetHotend(hotendPreheat, 0);
}
#elif ENABLED(WAIT_FOR_BED_HEAT)
@ -378,7 +378,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
const celsius_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0;
if (bedPreheat) {
if (hotendPreheat) DEBUG_ECHOPGM(" and ");
DEBUG_ECHOPAIR("bed (", bedPreheat, ")");
DEBUG_ECHOPGM("bed (", bedPreheat, ")");
thermalManager.setTargetBed(bedPreheat);
}
#endif
@ -400,7 +400,7 @@ bool Probe::set_deployed(const bool deploy) {
if (DEBUGGING(LEVELING)) {
DEBUG_POS("Probe::set_deployed", current_position);
DEBUG_ECHOLNPAIR("deploy: ", deploy);
DEBUG_ECHOLNPGM("deploy: ", deploy);
}
if (endstops.z_probe_enabled == deploy) return false;
@ -629,7 +629,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
const float first_probe_z = current_position.z;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("1st Probe Z:", first_probe_z);
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("1st Probe Z:", first_probe_z);
// Raise to give the probe clearance
do_blocking_move_to_z(current_position.z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s);
@ -723,7 +723,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
const float z2 = current_position.z;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2);
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2);
// Return a weighted average of the fast and slow probes
const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2;
@ -751,7 +751,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING));
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPAIR(
DEBUG_ECHOLNPGM(
"...(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry),
", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_LAST_STOW ? "stow (last)" : raise_after == PROBE_PT_STOW ? "stow" : "none",
", ", verbose_level,
@ -788,7 +788,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
if (stow()) measured_z = NAN; // Error on stow?
if (verbose_level > 2)
SERIAL_ECHOLNPAIR("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z);
SERIAL_ECHOLNPGM("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z);
}
if (isnan(measured_z)) {
@ -864,7 +864,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
#endif
#if ((ENABLED(DELTA) && (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(Y))) || HAS_CURRENT_HOME(Z))
auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) {
if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b); }
if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); }
};
#endif
if (onoff) {