|
|
@ -285,7 +285,7 @@ const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42
|
|
|
|
// Inactivity shutdown
|
|
|
|
// Inactivity shutdown
|
|
|
|
millis_t previous_cmd_ms = 0;
|
|
|
|
millis_t previous_cmd_ms = 0;
|
|
|
|
static millis_t max_inactive_time = 0;
|
|
|
|
static millis_t max_inactive_time = 0;
|
|
|
|
static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L;
|
|
|
|
static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000L;
|
|
|
|
millis_t print_job_start_ms = 0; ///< Print job start time
|
|
|
|
millis_t print_job_start_ms = 0; ///< Print job start time
|
|
|
|
millis_t print_job_stop_ms = 0; ///< Print job stop time
|
|
|
|
millis_t print_job_stop_ms = 0; ///< Print job stop time
|
|
|
|
static uint8_t target_extruder;
|
|
|
|
static uint8_t target_extruder;
|
|
|
@ -1638,13 +1638,13 @@ static void setup_for_endstop_move() {
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
if (marlin_debug_flags & DEBUG_LEVELING) {
|
|
|
|
if (marlin_debug_flags & DEBUG_LEVELING) {
|
|
|
|
SERIAL_ECHOPAIR("> do_blocking_move_to_xy ", x - X_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
|
SERIAL_ECHOPAIR("> do_blocking_move_to_xy ", x - (X_PROBE_OFFSET_FROM_EXTRUDER));
|
|
|
|
SERIAL_ECHOPAIR(", ", y - Y_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
|
SERIAL_ECHOPAIR(", ", y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
|
|
|
|
SERIAL_EOL;
|
|
|
|
SERIAL_EOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
do_blocking_move_to_xy(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER); // this also updates current_position
|
|
|
|
do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); // this also updates current_position
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
|
|
|
|
#if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
|
|
|
|
if (probe_action & ProbeDeploy) {
|
|
|
|
if (probe_action & ProbeDeploy) {
|
|
|
@ -2281,7 +2281,7 @@ inline void gcode_G28() {
|
|
|
|
sync_plan_position();
|
|
|
|
sync_plan_position();
|
|
|
|
|
|
|
|
|
|
|
|
// Move all carriages up together until the first endstop is hit.
|
|
|
|
// Move all carriages up together until the first endstop is hit.
|
|
|
|
for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH;
|
|
|
|
for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * (Z_MAX_LENGTH);
|
|
|
|
feedrate = 1.732 * homing_feedrate[X_AXIS];
|
|
|
|
feedrate = 1.732 * homing_feedrate[X_AXIS];
|
|
|
|
line_to_destination();
|
|
|
|
line_to_destination();
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
@ -2330,7 +2330,7 @@ inline void gcode_G28() {
|
|
|
|
feedrate = max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s)
|
|
|
|
feedrate = max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
if (marlin_debug_flags & DEBUG_LEVELING) {
|
|
|
|
if (marlin_debug_flags & DEBUG_LEVELING) {
|
|
|
|
SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)MIN_Z_HEIGHT_FOR_HOMING);
|
|
|
|
SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)(MIN_Z_HEIGHT_FOR_HOMING));
|
|
|
|
SERIAL_EOL;
|
|
|
|
SERIAL_EOL;
|
|
|
|
print_xyz("> (home_all_axis || homeZ) > current_position", current_position);
|
|
|
|
print_xyz("> (home_all_axis || homeZ) > current_position", current_position);
|
|
|
|
print_xyz("> (home_all_axis || homeZ) > destination", destination);
|
|
|
|
print_xyz("> (home_all_axis || homeZ) > destination", destination);
|
|
|
@ -2467,8 +2467,8 @@ inline void gcode_G28() {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Set the Z probe (or just the nozzle) destination to the safe homing point
|
|
|
|
// Set the Z probe (or just the nozzle) destination to the safe homing point
|
|
|
|
//
|
|
|
|
//
|
|
|
|
destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
|
destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER));
|
|
|
|
destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
|
destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER));
|
|
|
|
destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
|
|
|
|
destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
|
|
|
|
feedrate = XY_TRAVEL_SPEED;
|
|
|
|
feedrate = XY_TRAVEL_SPEED;
|
|
|
|
|
|
|
|
|
|
|
@ -2500,10 +2500,10 @@ inline void gcode_G28() {
|
|
|
|
// Make sure the Z probe is within the physical limits
|
|
|
|
// Make sure the Z probe is within the physical limits
|
|
|
|
// NOTE: This doesn't necessarily ensure the Z probe is also within the bed!
|
|
|
|
// NOTE: This doesn't necessarily ensure the Z probe is also within the bed!
|
|
|
|
float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
|
|
|
|
float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
|
|
|
|
if ( cpx >= X_MIN_POS - X_PROBE_OFFSET_FROM_EXTRUDER
|
|
|
|
if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
|
|
|
|
&& cpx <= X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER
|
|
|
|
&& cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
|
|
|
|
&& cpy >= Y_MIN_POS - Y_PROBE_OFFSET_FROM_EXTRUDER
|
|
|
|
&& cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
|
|
|
|
&& cpy <= Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER) {
|
|
|
|
&& cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) {
|
|
|
|
|
|
|
|
|
|
|
|
// Home the Z axis
|
|
|
|
// Home the Z axis
|
|
|
|
HOMEAXIS(Z);
|
|
|
|
HOMEAXIS(Z);
|
|
|
@ -2669,8 +2669,8 @@ inline void gcode_G28() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// For others, save the Z of the previous point, then raise Z again.
|
|
|
|
// For others, save the Z of the previous point, then raise Z again.
|
|
|
|
ix = (probe_point - 1) % MESH_NUM_X_POINTS;
|
|
|
|
ix = (probe_point - 1) % (MESH_NUM_X_POINTS);
|
|
|
|
iy = (probe_point - 1) / MESH_NUM_X_POINTS;
|
|
|
|
iy = (probe_point - 1) / (MESH_NUM_X_POINTS);
|
|
|
|
if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
|
|
|
|
if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
|
|
|
|
mbl.set_z(ix, iy, current_position[Z_AXIS]);
|
|
|
|
mbl.set_z(ix, iy, current_position[Z_AXIS]);
|
|
|
|
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
|
|
|
|
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
|
|
|
@ -2678,9 +2678,9 @@ inline void gcode_G28() {
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Is there another point to sample? Move there.
|
|
|
|
// Is there another point to sample? Move there.
|
|
|
|
if (probe_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
|
|
|
|
if (probe_point < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
|
|
|
|
ix = probe_point % MESH_NUM_X_POINTS;
|
|
|
|
ix = probe_point % (MESH_NUM_X_POINTS);
|
|
|
|
iy = probe_point / MESH_NUM_X_POINTS;
|
|
|
|
iy = probe_point / (MESH_NUM_X_POINTS);
|
|
|
|
if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
|
|
|
|
if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
|
|
|
|
current_position[X_AXIS] = mbl.get_x(ix);
|
|
|
|
current_position[X_AXIS] = mbl.get_x(ix);
|
|
|
|
current_position[Y_AXIS] = mbl.get_y(iy);
|
|
|
|
current_position[Y_AXIS] = mbl.get_y(iy);
|
|
|
@ -2832,18 +2832,18 @@ inline void gcode_G28() {
|
|
|
|
back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
|
|
|
|
back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
|
|
|
|
|
|
|
|
|
|
|
|
bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
|
|
|
|
bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
|
|
|
|
left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE,
|
|
|
|
left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE),
|
|
|
|
right_out_r = right_probe_bed_position > MAX_PROBE_X,
|
|
|
|
right_out_r = right_probe_bed_position > MAX_PROBE_X,
|
|
|
|
right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
|
|
|
|
right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
|
|
|
|
front_out_f = front_probe_bed_position < MIN_PROBE_Y,
|
|
|
|
front_out_f = front_probe_bed_position < MIN_PROBE_Y,
|
|
|
|
front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - MIN_PROBE_EDGE,
|
|
|
|
front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - (MIN_PROBE_EDGE),
|
|
|
|
back_out_b = back_probe_bed_position > MAX_PROBE_Y,
|
|
|
|
back_out_b = back_probe_bed_position > MAX_PROBE_Y,
|
|
|
|
back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
|
|
|
|
back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
|
|
|
|
|
|
|
|
|
|
|
|
if (left_out || right_out || front_out || back_out) {
|
|
|
|
if (left_out || right_out || front_out || back_out) {
|
|
|
|
if (left_out) {
|
|
|
|
if (left_out) {
|
|
|
|
out_of_range_error(PSTR("(L)eft"));
|
|
|
|
out_of_range_error(PSTR("(L)eft"));
|
|
|
|
left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - MIN_PROBE_EDGE;
|
|
|
|
left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - (MIN_PROBE_EDGE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (right_out) {
|
|
|
|
if (right_out) {
|
|
|
|
out_of_range_error(PSTR("(R)ight"));
|
|
|
|
out_of_range_error(PSTR("(R)ight"));
|
|
|
@ -2851,7 +2851,7 @@ inline void gcode_G28() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (front_out) {
|
|
|
|
if (front_out) {
|
|
|
|
out_of_range_error(PSTR("(F)ront"));
|
|
|
|
out_of_range_error(PSTR("(F)ront"));
|
|
|
|
front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - MIN_PROBE_EDGE;
|
|
|
|
front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - (MIN_PROBE_EDGE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (back_out) {
|
|
|
|
if (back_out) {
|
|
|
|
out_of_range_error(PSTR("(B)ack"));
|
|
|
|
out_of_range_error(PSTR("(B)ack"));
|
|
|
@ -3597,7 +3597,7 @@ inline void gcode_M42() {
|
|
|
|
bool deploy_probe_for_each_reading = code_seen('E');
|
|
|
|
bool deploy_probe_for_each_reading = code_seen('E');
|
|
|
|
|
|
|
|
|
|
|
|
if (code_seen('X')) {
|
|
|
|
if (code_seen('X')) {
|
|
|
|
X_probe_location = code_value() - X_PROBE_OFFSET_FROM_EXTRUDER;
|
|
|
|
X_probe_location = code_value() - (X_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
|
if (X_probe_location < X_MIN_POS || X_probe_location > X_MAX_POS) {
|
|
|
|
if (X_probe_location < X_MIN_POS || X_probe_location > X_MAX_POS) {
|
|
|
|
out_of_range_error(PSTR("X"));
|
|
|
|
out_of_range_error(PSTR("X"));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -3677,7 +3677,7 @@ inline void gcode_M42() {
|
|
|
|
|
|
|
|
|
|
|
|
if (n_legs) {
|
|
|
|
if (n_legs) {
|
|
|
|
millis_t ms = millis();
|
|
|
|
millis_t ms = millis();
|
|
|
|
double radius = ms % (X_MAX_LENGTH / 4), // limit how far out to go
|
|
|
|
double radius = ms % ((X_MAX_LENGTH) / 4), // limit how far out to go
|
|
|
|
theta = RADIANS(ms % 360L);
|
|
|
|
theta = RADIANS(ms % 360L);
|
|
|
|
float dir = (ms & 0x0001) ? 1 : -1; // clockwise or counter clockwise
|
|
|
|
float dir = (ms & 0x0001) ? 1 : -1; // clockwise or counter clockwise
|
|
|
|
|
|
|
|
|
|
|
@ -3832,7 +3832,7 @@ inline void gcode_M104() {
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
SERIAL_PROTOCOLPGM(" B@:");
|
|
|
|
SERIAL_PROTOCOLPGM(" B@:");
|
|
|
|
#ifdef BED_WATTS
|
|
|
|
#ifdef BED_WATTS
|
|
|
|
SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1)) / 127);
|
|
|
|
SERIAL_PROTOCOL(((BED_WATTS) * getHeaterPower(-1)) / 127);
|
|
|
|
SERIAL_PROTOCOLCHAR('W');
|
|
|
|
SERIAL_PROTOCOLCHAR('W');
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
SERIAL_PROTOCOL(getHeaterPower(-1));
|
|
|
|
SERIAL_PROTOCOL(getHeaterPower(-1));
|
|
|
@ -3840,7 +3840,7 @@ inline void gcode_M104() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
SERIAL_PROTOCOLPGM(" @:");
|
|
|
|
SERIAL_PROTOCOLPGM(" @:");
|
|
|
|
#ifdef EXTRUDER_WATTS
|
|
|
|
#ifdef EXTRUDER_WATTS
|
|
|
|
SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder)) / 127);
|
|
|
|
SERIAL_PROTOCOL(((EXTRUDER_WATTS) * getHeaterPower(target_extruder)) / 127);
|
|
|
|
SERIAL_PROTOCOLCHAR('W');
|
|
|
|
SERIAL_PROTOCOLCHAR('W');
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
SERIAL_PROTOCOL(getHeaterPower(target_extruder));
|
|
|
|
SERIAL_PROTOCOL(getHeaterPower(target_extruder));
|
|
|
@ -3851,7 +3851,7 @@ inline void gcode_M104() {
|
|
|
|
SERIAL_PROTOCOL(e);
|
|
|
|
SERIAL_PROTOCOL(e);
|
|
|
|
SERIAL_PROTOCOLCHAR(':');
|
|
|
|
SERIAL_PROTOCOLCHAR(':');
|
|
|
|
#ifdef EXTRUDER_WATTS
|
|
|
|
#ifdef EXTRUDER_WATTS
|
|
|
|
SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(e)) / 127);
|
|
|
|
SERIAL_PROTOCOL(((EXTRUDER_WATTS) * getHeaterPower(e)) / 127);
|
|
|
|
SERIAL_PROTOCOLCHAR('W');
|
|
|
|
SERIAL_PROTOCOLCHAR('W');
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
SERIAL_PROTOCOL(getHeaterPower(e));
|
|
|
|
SERIAL_PROTOCOL(getHeaterPower(e));
|
|
|
@ -3943,7 +3943,7 @@ inline void gcode_M109() {
|
|
|
|
#ifdef TEMP_RESIDENCY_TIME
|
|
|
|
#ifdef TEMP_RESIDENCY_TIME
|
|
|
|
long residency_start_ms = -1;
|
|
|
|
long residency_start_ms = -1;
|
|
|
|
// Loop until the temperature has stabilized
|
|
|
|
// Loop until the temperature has stabilized
|
|
|
|
#define TEMP_CONDITIONS (residency_start_ms < 0 || now < residency_start_ms + TEMP_RESIDENCY_TIME * 1000UL)
|
|
|
|
#define TEMP_CONDITIONS (residency_start_ms < 0 || now < residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
// Loop until the temperature is very close target
|
|
|
|
// Loop until the temperature is very close target
|
|
|
|
#define TEMP_CONDITIONS (fabs(degHotend(target_extruder) - degTargetHotend(target_extruder)) < 0.75f)
|
|
|
|
#define TEMP_CONDITIONS (fabs(degHotend(target_extruder) - degTargetHotend(target_extruder)) < 0.75f)
|
|
|
@ -3961,7 +3961,7 @@ inline void gcode_M109() {
|
|
|
|
#ifdef TEMP_RESIDENCY_TIME
|
|
|
|
#ifdef TEMP_RESIDENCY_TIME
|
|
|
|
SERIAL_PROTOCOLPGM(" W:");
|
|
|
|
SERIAL_PROTOCOLPGM(" W:");
|
|
|
|
if (residency_start_ms >= 0) {
|
|
|
|
if (residency_start_ms >= 0) {
|
|
|
|
long rem = ((TEMP_RESIDENCY_TIME * 1000UL) - (now - residency_start_ms)) / 1000UL;
|
|
|
|
long rem = (((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL;
|
|
|
|
SERIAL_PROTOCOLLN(rem);
|
|
|
|
SERIAL_PROTOCOLLN(rem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
@ -5533,7 +5533,7 @@ inline void gcode_M907() {
|
|
|
|
// this one uses actual amps in floating point
|
|
|
|
// this one uses actual amps in floating point
|
|
|
|
for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
|
|
|
|
for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
|
|
|
|
// for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
|
|
|
|
// for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
|
|
|
|
for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - NUM_AXIS)) digipot_i2c_set_current(i, code_value());
|
|
|
|
for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value());
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -6821,7 +6821,7 @@ void plan_arc(
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
lastMotor = ms; //... set time to NOW so the fan will turn on
|
|
|
|
lastMotor = ms; //... set time to NOW so the fan will turn on
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
|
|
|
|
uint8_t speed = (lastMotor == 0 || ms >= lastMotor + ((CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
|
|
|
|
// allows digital or PWM fan output to be used (see M42 handling)
|
|
|
|
// allows digital or PWM fan output to be used (see M42 handling)
|
|
|
|
digitalWrite(CONTROLLERFAN_PIN, speed);
|
|
|
|
digitalWrite(CONTROLLERFAN_PIN, speed);
|
|
|
|
analogWrite(CONTROLLERFAN_PIN, speed);
|
|
|
|
analogWrite(CONTROLLERFAN_PIN, speed);
|
|
|
@ -7054,7 +7054,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(EXTRUDER_RUNOUT_PREVENT)
|
|
|
|
#if ENABLED(EXTRUDER_RUNOUT_PREVENT)
|
|
|
|
if (ms > previous_cmd_ms + EXTRUDER_RUNOUT_SECONDS * 1000)
|
|
|
|
if (ms > previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000)
|
|
|
|
if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
|
|
|
|
if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
|
|
|
|
bool oldstatus;
|
|
|
|
bool oldstatus;
|
|
|
|
switch (active_extruder) {
|
|
|
|
switch (active_extruder) {
|
|
|
@ -7083,8 +7083,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
|
|
|
|
float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
|
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
|
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
|
|
|
|
destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS],
|
|
|
|
destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / axis_steps_per_unit[E_AXIS],
|
|
|
|
EXTRUDER_RUNOUT_SPEED / 60. * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS], active_extruder);
|
|
|
|
(EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / axis_steps_per_unit[E_AXIS], active_extruder);
|
|
|
|
current_position[E_AXIS] = oldepos;
|
|
|
|
current_position[E_AXIS] = oldepos;
|
|
|
|
destination[E_AXIS] = oldedes;
|
|
|
|
destination[E_AXIS] = oldedes;
|
|
|
|
plan_set_e_position(oldepos);
|
|
|
|
plan_set_e_position(oldepos);
|
|
|
|