Move Stepper::synchronize to Planner (#10713)

Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
Scott Lahteine
2018-05-12 01:38:02 -05:00
committed by GitHub
parent f2e3c9896e
commit 306f0f2135
33 changed files with 72 additions and 73 deletions

View File

@ -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) {
@ -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;
@ -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();
@ -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);

View File

@ -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);
@ -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);

View File

@ -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();
}
/**
@ -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))

View File

@ -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:

View File

@ -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);