Move Stepper::synchronize to Planner (#10713)
Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
@ -500,7 +500,7 @@ inline bool prime_nozzle() {
|
||||
#endif
|
||||
G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
|
||||
set_destination_from_current();
|
||||
stepper.synchronize(); // Without this synchronize, the purge is more consistent,
|
||||
planner.synchronize(); // Without this synchronize, the purge is more consistent,
|
||||
// but because the planner has a buffer, we won't be able
|
||||
// to stop as quickly. So we put up with the less smooth
|
||||
// action to give the user a more responsive 'Stop'.
|
||||
|
@ -391,7 +391,7 @@ void GcodeSuite::G29() {
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
// Disable auto bed leveling during G29.
|
||||
// Be formal so G29 can be done successively without G28.
|
||||
@ -949,7 +949,7 @@ void GcodeSuite::G29() {
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
|
||||
#endif
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT));
|
||||
#endif
|
||||
|
||||
|
@ -132,7 +132,7 @@ void GcodeSuite::G29() {
|
||||
// One last "return to the bed" (as originally coded) at completion
|
||||
current_position[Z_AXIS] = MANUAL_PROBE_HEIGHT;
|
||||
line_to_current_position();
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
// After recording the last point, activate home and activate
|
||||
mbl_probe_index = -1;
|
||||
@ -147,7 +147,7 @@ void GcodeSuite::G29() {
|
||||
current_position[Z_AXIS] = 0;
|
||||
set_destination_from_current();
|
||||
buffer_line_to_destination(homing_feedrate(Z_AXIS));
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_BED_LEVELING)
|
||||
|
@ -171,7 +171,7 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
#endif
|
||||
|
||||
// Wait for planner moves to finish!
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
// Cancel the active G29 session
|
||||
#if ENABLED(PROBE_MANUALLY)
|
||||
|
@ -85,7 +85,7 @@ void ac_setup(const bool reset_bed) {
|
||||
tool_change(0, 0, true);
|
||||
#endif
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
setup_for_endstop_or_probe_move();
|
||||
|
||||
#if HAS_LEVELING
|
||||
|
@ -50,7 +50,7 @@ void GcodeSuite::M18_M84() {
|
||||
stepper.finish_and_disable();
|
||||
}
|
||||
else {
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
if (parser.seen('X')) disable_X();
|
||||
if (parser.seen('Y')) disable_Y();
|
||||
if (parser.seen('Z')) disable_Z();
|
||||
|
@ -37,7 +37,7 @@ void GcodeSuite::M226() {
|
||||
|
||||
int target = LOW;
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
pinMode(pin, INPUT);
|
||||
switch (pin_state) {
|
||||
|
@ -79,7 +79,7 @@ inline void ocr_val_mode() {
|
||||
|
||||
void GcodeSuite::M3_M4(bool is_M3) {
|
||||
|
||||
stepper.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle
|
||||
planner.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle
|
||||
#if SPINDLE_DIR_CHANGE
|
||||
const bool rotation_dir = (is_M3 != SPINDLE_INVERT_DIR);
|
||||
if (SPINDLE_STOP_ON_DIR_CHANGE \
|
||||
@ -129,7 +129,7 @@ void GcodeSuite::M3_M4(bool is_M3) {
|
||||
* M5 turn off spindle
|
||||
*/
|
||||
void GcodeSuite::M5() {
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT);
|
||||
#if ENABLED(SPINDLE_LASER_PWM)
|
||||
analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0);
|
||||
|
@ -28,6 +28,6 @@
|
||||
*/
|
||||
void GcodeSuite::M400() {
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
* Note: the X axis should be homed after changing dual x-carriage mode.
|
||||
*/
|
||||
void GcodeSuite::M605() {
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
if (parser.seen('S')) dual_x_carriage_mode = (DualXMode)parser.value_byte();
|
||||
switch (dual_x_carriage_mode) {
|
||||
case DXC_FULL_CONTROL_MODE:
|
||||
@ -75,7 +75,7 @@
|
||||
#elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
||||
|
||||
void GcodeSuite::M605() {
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
extruder_duplication_enabled = parser.intval('S') == (int)DXC_DUPLICATION_MODE;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF);
|
||||
|
@ -37,7 +37,7 @@ void GcodeSuite::M900() {
|
||||
if (parser.seenval('K')) {
|
||||
const float newK = parser.floatval('K');
|
||||
if (WITHIN(newK, 0, 10)) {
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
planner.extruder_advance_K = newK;
|
||||
}
|
||||
else
|
||||
|
@ -33,7 +33,7 @@
|
||||
*/
|
||||
bool GcodeSuite::select_coordinate_system(const int8_t _new) {
|
||||
if (active_coordinate_system == _new) return false;
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 };
|
||||
if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1))
|
||||
COPY(old_offset, coordinate_system[active_coordinate_system]);
|
||||
|
@ -77,7 +77,7 @@
|
||||
report_xyz(delta);
|
||||
#endif
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
SERIAL_PROTOCOLPGM("Stepper:");
|
||||
LOOP_XYZE(i) {
|
||||
@ -126,6 +126,6 @@ void GcodeSuite::M114() {
|
||||
}
|
||||
#endif
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
report_current_position();
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
const bool has_message = !hasP && !hasS && args && *args;
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
|
||||
|
@ -84,7 +84,7 @@ void GcodeSuite::G0_G1(
|
||||
#define _MOVE_SYNC parser.seenval('Z') // Only for Z move
|
||||
#endif
|
||||
if (_MOVE_SYNC) {
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP);
|
||||
}
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ void GcodeSuite::G4() {
|
||||
if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
|
||||
if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait
|
||||
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
#if ENABLED(NANODLP_Z_SYNC)
|
||||
SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP);
|
||||
#endif
|
||||
|
@ -44,14 +44,14 @@ static bool G38_run_probe() {
|
||||
}
|
||||
#endif
|
||||
|
||||
stepper.synchronize(); // wait until the machine is idle
|
||||
planner.synchronize(); // wait until the machine is idle
|
||||
|
||||
// Move until destination reached or target hit
|
||||
endstops.enable(true);
|
||||
G38_move = true;
|
||||
G38_endstop_hit = false;
|
||||
prepare_move_to_destination();
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
G38_move = false;
|
||||
|
||||
endstops.hit_on_purpose();
|
||||
@ -68,7 +68,7 @@ static bool G38_run_probe() {
|
||||
LOOP_XYZ(i) destination[i] += retract_mm[i];
|
||||
endstops.enable(false);
|
||||
prepare_move_to_destination();
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
|
||||
feedrate_mm_s /= 4;
|
||||
|
||||
@ -78,7 +78,7 @@ static bool G38_run_probe() {
|
||||
endstops.enable(true);
|
||||
G38_move = true;
|
||||
prepare_move_to_destination();
|
||||
stepper.synchronize();
|
||||
planner.synchronize();
|
||||
G38_move = false;
|
||||
|
||||
set_current_from_steppers_for_axis(ALL_AXES);
|
||||
|
@ -179,7 +179,7 @@ void GcodeSuite::M30() {
|
||||
*
|
||||
*/
|
||||
void GcodeSuite::M32() {
|
||||
if (card.sdprinting) stepper.synchronize();
|
||||
if (card.sdprinting) planner.synchronize();
|
||||
|
||||
if (card.cardOK) {
|
||||
const bool call_procedure = parser.boolval('P');
|
||||
|
Reference in New Issue
Block a user