Rename some feedrate-oriented functions

This commit is contained in:
Scott Lahteine 2019-09-23 20:58:01 -05:00
parent 938a49f989
commit 5e13fe989f
8 changed files with 20 additions and 16 deletions

View file

@ -446,7 +446,7 @@ G29_TYPE GcodeSuite::G29() {
} }
#endif #endif
if (!faux) setup_for_endstop_or_probe_move(); if (!faux) remember_feedrate_scaling_off();
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
@ -980,7 +980,7 @@ G29_TYPE GcodeSuite::G29() {
} // !isnan(measured_z) } // !isnan(measured_z)
// Restore state after probing // Restore state after probing
if (!faux) clean_up_after_endstop_or_probe_move(); if (!faux) restore_feedrate_and_scaling();
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29"); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29");

View file

@ -261,7 +261,7 @@ void GcodeSuite::G28(const bool always_home_all) {
extruder_duplication_enabled = false; extruder_duplication_enabled = false;
#endif #endif
setup_for_endstop_or_probe_move(); remember_feedrate_scaling_off();
endstops.enable(true); // Enable endstops for next homing move endstops.enable(true); // Enable endstops for next homing move
@ -427,7 +427,7 @@ void GcodeSuite::G28(const bool always_home_all) {
set_bed_leveling_enabled(leveling_was_active); set_bed_leveling_enabled(leveling_was_active);
#endif #endif
clean_up_after_endstop_or_probe_move(); restore_feedrate_and_scaling();
// Restore the active tool after homing // Restore the active tool after homing
#if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE))

View file

@ -84,7 +84,7 @@ void ac_setup(const bool reset_bed) {
#endif #endif
planner.synchronize(); planner.synchronize();
setup_for_endstop_or_probe_move(); remember_feedrate_scaling_off();
#if HAS_LEVELING #if HAS_LEVELING
if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid
@ -102,7 +102,7 @@ void ac_cleanup(
#if HAS_BED_PROBE #if HAS_BED_PROBE
STOW_PROBE(); STOW_PROBE();
#endif #endif
clean_up_after_endstop_or_probe_move(); restore_feedrate_and_scaling();
#if HOTENDS > 1 #if HOTENDS > 1
tool_change(old_tool_index, true); tool_change(old_tool_index, true);
#endif #endif

View file

@ -111,7 +111,7 @@ void GcodeSuite::M48() {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
#endif #endif
setup_for_endstop_or_probe_move(); remember_feedrate_scaling_off();
float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples]; float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples];
@ -256,7 +256,7 @@ void GcodeSuite::M48() {
#endif #endif
} }
clean_up_after_endstop_or_probe_move(); restore_feedrate_and_scaling();
// Re-enable bed level correction if it had been on // Re-enable bed level correction if it had been on
#if HAS_LEVELING #if HAS_LEVELING

View file

@ -49,7 +49,7 @@ void GcodeSuite::G30() {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
#endif #endif
setup_for_endstop_or_probe_move(); remember_feedrate_scaling_off();
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
const float measured_z = probe_at_point(xpos, ypos, raise_after, 1); const float measured_z = probe_at_point(xpos, ypos, raise_after, 1);
@ -57,7 +57,7 @@ void GcodeSuite::G30() {
if (!isnan(measured_z)) if (!isnan(measured_z))
SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(xpos), " Y: ", FIXFLOAT(ypos), " Z: ", FIXFLOAT(measured_z)); SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(xpos), " Y: ", FIXFLOAT(ypos), " Z: ", FIXFLOAT(measured_z));
clean_up_after_endstop_or_probe_move(); restore_feedrate_and_scaling();
#ifdef Z_AFTER_PROBING #ifdef Z_AFTER_PROBING
if (raise_after == PROBE_PT_STOW) move_z_after_probing(); if (raise_after == PROBE_PT_STOW) move_z_after_probing();

View file

@ -109,7 +109,7 @@ void GcodeSuite::G38(const int8_t subcode) {
// Get X Y Z E F // Get X Y Z E F
get_destination_from_command(); get_destination_from_command();
setup_for_endstop_or_probe_move(); remember_feedrate_scaling_off();
const bool error_on_fail = const bool error_on_fail =
#if ENABLED(G38_PROBE_AWAY) #if ENABLED(G38_PROBE_AWAY)
@ -128,7 +128,7 @@ void GcodeSuite::G38(const int8_t subcode) {
break; break;
} }
clean_up_after_endstop_or_probe_move(); restore_feedrate_and_scaling();
} }
#endif // G38_PROBE_TARGET #endif // G38_PROBE_TARGET

View file

@ -439,12 +439,15 @@ void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm
// //
static float saved_feedrate_mm_s; static float saved_feedrate_mm_s;
static int16_t saved_feedrate_percentage; static int16_t saved_feedrate_percentage;
void setup_for_endstop_or_probe_move() { void remember_feedrate_and_scaling() {
saved_feedrate_mm_s = feedrate_mm_s; saved_feedrate_mm_s = feedrate_mm_s;
saved_feedrate_percentage = feedrate_percentage; saved_feedrate_percentage = feedrate_percentage;
}
void remember_feedrate_scaling_off() {
remember_feedrate_and_scaling();
feedrate_percentage = 100; feedrate_percentage = 100;
} }
void clean_up_after_endstop_or_probe_move() { void restore_feedrate_and_scaling() {
feedrate_mm_s = saved_feedrate_mm_s; feedrate_mm_s = saved_feedrate_mm_s;
feedrate_percentage = saved_feedrate_percentage; feedrate_percentage = saved_feedrate_percentage;
} }

View file

@ -203,8 +203,9 @@ FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZE], const float &fr_
do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s);
} }
void setup_for_endstop_or_probe_move(); void remember_feedrate_and_scaling();
void clean_up_after_endstop_or_probe_move(); void remember_feedrate_scaling_off();
void restore_feedrate_and_scaling();
// //
// Homing // Homing