Simpler Allen Key config. Fixes, cleanups from refactor (#15256)

This commit is contained in:
Scott Lahteine
2019-09-14 03:05:10 -05:00
committed by GitHub
parent ffb418b226
commit 465c6d9230
62 changed files with 389 additions and 685 deletions

View File

@ -1174,7 +1174,10 @@ void Planner::recalculate() {
* Maintain fans, paste extruder pressure,
*/
void Planner::check_axes_activity() {
uint8_t axis_active[NUM_AXIS] = { 0 };
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E)
uint8_t axis_active[NUM_AXIS] = { 0 };
#endif
#if FAN_COUNT > 0
uint8_t tail_fan_speed[FAN_COUNT];
@ -1190,10 +1193,9 @@ void Planner::check_axes_activity() {
#endif
if (has_blocks_queued()) {
block_t* block;
#if FAN_COUNT > 0 || ENABLED(BARICUDA)
block = &block_buffer[block_buffer_tail];
block_t *block = &block_buffer[block_buffer_tail];
#endif
#if FAN_COUNT > 0
@ -1210,10 +1212,12 @@ void Planner::check_axes_activity() {
#endif
#endif
for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
block = &block_buffer[b];
LOOP_XYZE(i) if (block->steps[i]) axis_active[i]++;
}
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E)
for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
block_t *block = &block_buffer[b];
LOOP_XYZE(i) if (block->steps[i]) axis_active[i] = true;
}
#endif
}
else {
#if FAN_COUNT > 0
@ -1517,14 +1521,14 @@ float Planner::get_axis_position_mm(const AxisEnum axis) {
const bool was_enabled = STEPPER_ISR_ENABLED();
if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT();
// ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
// ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2
axis_steps = 0.5f * (
axis == CORE_AXIS_2 ? CORESIGN(stepper.position(CORE_AXIS_1) - stepper.position(CORE_AXIS_2))
: stepper.position(CORE_AXIS_1) + stepper.position(CORE_AXIS_2)
);
const int32_t p1 = stepper.position(CORE_AXIS_1),
p2 = stepper.position(CORE_AXIS_2);
if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT();
// ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
// ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2
axis_steps = (axis == CORE_AXIS_2 ? CORESIGN(p1 - p2) : p1 + p2) * 0.5f;
}
else
axis_steps = stepper.position(axis);
@ -1551,11 +1555,11 @@ void Planner::synchronize() {
*
* Add a new linear movement to the planner queue (in terms of steps).
*
* target - target position in steps units
* target_float - target position in direct (mm, degrees) units. optional
* fr_mm_s - (target) speed of the move
* extruder - target extruder
* millimeters - the length of the movement, if known
* target - target position in steps units
* target_float - target position in direct (mm, degrees) units. optional
* fr_mm_s - (target) speed of the move
* extruder - target extruder
* millimeters - the length of the movement, if known
*
* Returns true if movement was properly queued, false otherwise
*/
@ -1644,18 +1648,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#endif
/* <-- add a slash to enable
SERIAL_ECHOPAIR(" _populate_block FR:", fr_mm_s);
SERIAL_ECHOPAIR(" A:", target[A_AXIS]);
SERIAL_ECHOPAIR(" (", da);
SERIAL_ECHOPAIR(" steps) B:", target[B_AXIS]);
SERIAL_ECHOPAIR(" (", db);
SERIAL_ECHOPAIR(" steps) C:", target[C_AXIS]);
SERIAL_ECHOPAIR(" (", dc);
#if EXTRUDERS
SERIAL_ECHOPAIR(" steps) E:", target[E_AXIS]);
SERIAL_ECHOPAIR(" (", de);
#endif
SERIAL_ECHOLNPGM(" steps)");
SERIAL_ECHOLNPAIR(" _populate_block FR:", fr_mm_s,
" A:", target[A_AXIS], " (", da, " steps)"
" B:", target[B_AXIS], " (", db, " steps)"
" C:", target[C_AXIS], " (", dc, " steps)"
#if EXTRUDERS
" E:", target[E_AXIS], " (", de, " steps)"
#endif
);
//*/
#if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
@ -2633,7 +2633,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
//*/
// Queue the movement
if (
if (
!_buffer_steps(target
#if HAS_POSITION_FLOAT
, target_float