🎨 Misc. cleanup, string optimization

This commit is contained in:
Scott Lahteine
2022-04-09 22:52:36 -05:00
parent 46e282bd6d
commit e2353be24f
10 changed files with 73 additions and 57 deletions

View File

@@ -415,6 +415,21 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
#endif
/**
* Print an error and stop()
*/
void Probe::probe_error_stop() {
SERIAL_ERROR_START();
SERIAL_ECHOPGM(STR_STOP_PRE);
#if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)
SERIAL_ECHOPGM(STR_STOP_UNHOMED);
#elif ENABLED(BLTOUCH)
SERIAL_ECHOPGM(STR_STOP_BLTOUCH);
#endif
SERIAL_ECHOLNPGM(STR_STOP_POST);
stop();
}
/**
* Attempt to deploy or stow the probe
*
@@ -443,8 +458,7 @@ bool Probe::set_deployed(const bool deploy) {
#if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)
if (homing_needed_error(TERN_(Z_PROBE_SLED, _BV(X_AXIS)))) {
SERIAL_ERROR_MSG(STR_STOP_UNHOMED);
stop();
probe_error_stop();
return true;
}
#endif
@@ -484,15 +498,12 @@ bool Probe::set_deployed(const bool deploy) {
}
/**
* @brief Used by run_z_probe to do a single Z probe move.
* @brief Move down until the probe triggers or the low limit is reached
* Used by run_z_probe to do a single Z probe move.
*
* @param z Z destination
* @param fr_mm_s Feedrate in mm/s
* @return true to indicate an error
*/
/**
* @brief Move down until the probe triggers or the low limit is reached
*
* @details Used by run_z_probe to get each bed Z height measurement.
* Sets current_position.z to the height where the probe triggered