|
@@ -168,22 +168,19 @@ bool Stepper::abort_current_block;
|
168
|
168
|
|
169
|
169
|
#if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
|
170
|
170
|
bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false
|
171
|
|
- #if NUM_Z_STEPPER_DRIVERS >= 3
|
172
|
|
- , Stepper::locked_Z3_motor = false
|
173
|
|
- #if NUM_Z_STEPPER_DRIVERS >= 4
|
174
|
|
- , Stepper::locked_Z4_motor = false
|
175
|
|
- #endif
|
176
|
|
- #endif
|
177
|
|
- ;
|
|
171
|
+ #if NUM_Z_STEPPER_DRIVERS >= 3
|
|
172
|
+ , Stepper::locked_Z3_motor = false
|
|
173
|
+ #if NUM_Z_STEPPER_DRIVERS >= 4
|
|
174
|
+ , Stepper::locked_Z4_motor = false
|
|
175
|
+ #endif
|
|
176
|
+ #endif
|
|
177
|
+ ;
|
178
|
178
|
#endif
|
179
|
179
|
|
180
|
180
|
uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
|
181
|
181
|
uint8_t Stepper::steps_per_isr;
|
182
|
182
|
|
183
|
|
-#if DISABLED(ADAPTIVE_STEP_SMOOTHING)
|
184
|
|
- constexpr
|
185
|
|
-#endif
|
186
|
|
- uint8_t Stepper::oversampling_factor;
|
|
183
|
+TERN(ADAPTIVE_STEP_SMOOTHING,,constexpr) uint8_t Stepper::oversampling_factor;
|
187
|
184
|
|
188
|
185
|
xyze_long_t Stepper::delta_error{0};
|
189
|
186
|
|
|
@@ -2099,17 +2096,18 @@ uint32_t Stepper::block_phase_isr() {
|
2099
|
2096
|
// No acceleration / deceleration time elapsed so far
|
2100
|
2097
|
acceleration_time = deceleration_time = 0;
|
2101
|
2098
|
|
2102
|
|
- uint8_t oversampling = 0; // Assume no axis smoothing (via oversampling)
|
2103
|
|
-
|
2104
|
2099
|
#if ENABLED(ADAPTIVE_STEP_SMOOTHING)
|
|
2100
|
+ uint8_t oversampling = 0; // Assume no axis smoothing (via oversampling)
|
2105
|
2101
|
// Decide if axis smoothing is possible
|
2106
|
|
- uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed)
|
|
2102
|
+ uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed)
|
2107
|
2103
|
while (max_rate < MIN_STEP_ISR_FREQUENCY) { // As long as more ISRs are possible...
|
2108
|
2104
|
max_rate <<= 1; // Try to double the rate
|
2109
|
2105
|
if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; // Don't exceed the estimated ISR limit
|
2110
|
2106
|
++oversampling; // Increase the oversampling (used for left-shift)
|
2111
|
2107
|
}
|
2112
|
2108
|
oversampling_factor = oversampling; // For all timer interval calculations
|
|
2109
|
+ #else
|
|
2110
|
+ constexpr uint8_t oversampling = 0;
|
2113
|
2111
|
#endif
|
2114
|
2112
|
|
2115
|
2113
|
// Based on the oversampling factor, do the calculations
|