Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Marlin/src/Marlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ bool pin_is_protected(const pin_t pin) {

void quickstop_stepper() {
stepper.quick_stop();
stepper.synchronize();
planner.synchronize();
set_current_from_steppers_for_axis(ALL_AXES);
SYNC_PLAN_POSITION_KINEMATIC();
}
Expand Down Expand Up @@ -461,7 +461,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder);
current_position[E_AXIS] = olde;
planner.set_e_position_mm(olde);
stepper.synchronize();
planner.synchronize();
#if ENABLED(SWITCHING_EXTRUDER)
E0_ENABLE_WRITE(oldstatus);
#else
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/feature/I2CPositionEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ bool I2CPositionEncoder::test_axis() {
startCoord[encoderAxis] = startPosition;
endCoord[encoderAxis] = endPosition;

stepper.synchronize();
planner.synchronize();

planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS],
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
stepper.synchronize();
planner.synchronize();

// if the module isn't currently trusted, wait until it is (or until it should be if things are working)
if (!trusted) {
Expand All @@ -372,7 +372,7 @@ bool I2CPositionEncoder::test_axis() {
if (trusted) { // if trusted, commence test
planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS],
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
stepper.synchronize();
planner.synchronize();
}

return trusted;
Expand Down Expand Up @@ -415,12 +415,12 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {
startCoord[encoderAxis] = startDistance;
endCoord[encoderAxis] = endDistance;

stepper.synchronize();
planner.synchronize();

LOOP_L_N(i, iter) {
planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS],
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
stepper.synchronize();
planner.synchronize();

delay(250);
startCount = get_position();
Expand All @@ -429,7 +429,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {

planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS],
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
stepper.synchronize();
planner.synchronize();

//Read encoder distance
delay(250);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@

do_blocking_move_to(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
//, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
stepper.synchronize();
planner.synchronize();

SERIAL_PROTOCOLPGM("Place shim under nozzle");
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
Expand All @@ -806,7 +806,7 @@

const float z1 = measure_point_with_encoder();
do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE);
stepper.synchronize();
planner.synchronize();

SERIAL_PROTOCOLPGM("Remove shim");
LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static void do_pause_e_move(const float &length, const float &fr) {
destination[E_AXIS] += length / planner.e_factor[active_extruder];
planner.buffer_line_kinematic(destination, fr, active_extruder);
set_current_from_destination();
stepper.synchronize();
planner.synchronize();
}

/**
Expand Down Expand Up @@ -370,7 +370,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
COPY(resume_position, current_position);

// Wait for buffered blocks to complete
stepper.synchronize();
planner.synchronize();

// Initial retract before move to filament change position
if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/runout.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FilamentRunoutSensor {
if ((IS_SD_PRINTING || print_job_timer.isRunning()) && check() && !filament_ran_out) {
filament_ran_out = true;
enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
stepper.synchronize();
planner.synchronize();
}
}
private:
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/snmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "../module/stepper.h"

void select_multiplexed_stepper(const uint8_t e) {
stepper.synchronize();
planner.synchronize();
disable_e_steppers();
WRITE(E_MUX0_PIN, TEST(e, 0) ? HIGH : LOW);
WRITE(E_MUX1_PIN, TEST(e, 1) ? HIGH : LOW);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/control/M17_M18_M84.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/control/M226.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void GcodeSuite::M226() {

int target = LOW;

stepper.synchronize();
planner.synchronize();

pinMode(pin, INPUT);
switch (pin_state) {
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/control/M3-M5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/control/M400.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
*/
void GcodeSuite::M400() {

stepper.synchronize();
planner.synchronize();

}
4 changes: 2 additions & 2 deletions Marlin/src/gcode/control/M605.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/feature/advance/M900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/geometry/G53-G59.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/host/M114.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
report_xyz(delta);
#endif

stepper.synchronize();
planner.synchronize();

SERIAL_PROTOCOLPGM("Stepper:");
LOOP_XYZE(i) {
Expand Down Expand Up @@ -126,6 +126,6 @@ void GcodeSuite::M114() {
}
#endif

stepper.synchronize();
planner.synchronize();
report_current_position();
}
2 changes: 1 addition & 1 deletion Marlin/src/gcode/lcd/M0_M1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void GcodeSuite::M0_M1() {

const bool has_message = !hasP && !hasS && args && *args;

stepper.synchronize();
planner.synchronize();

#if ENABLED(ULTIPANEL)

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/motion/G0_G1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/motion/G4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/probe/G38.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ uint16_t max_display_update_time = 0;
no_reentry = true;
const screenFunc_t old_screen = currentScreen;
lcd_goto_screen(_lcd_synchronize);
stepper.synchronize(); // idle() is called until moves complete
planner.synchronize(); // idle() is called until moves complete
no_reentry = false;
lcd_goto_screen(old_screen);
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/delta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "motion.h"

// For homing:
#include "stepper.h"
#include "planner.h"
#include "endstops.h"
#include "../lcd/ultralcd.h"
#include "../Marlin.h"
Expand Down Expand Up @@ -258,7 +258,7 @@ bool home_delta() {
current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10);
feedrate_mm_s = homing_feedrate(X_AXIS);
line_to_current_position();
stepper.synchronize();
planner.synchronize();

// Re-enable stealthChop if used. Disable diag1 pin on driver.
#if ENABLED(SENSORLESS_HOMING)
Expand Down
Loading