Prusa MINI Firmware overview
stepper.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 /**
25  * stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors
26  * Derived from Grbl
27  *
28  * Copyright (c) 2009-2011 Simen Svale Skogsrud
29  *
30  * Grbl is free software: you can redistribute it and/or modify
31  * it under the terms of the GNU General Public License as published by
32  * the Free Software Foundation, either version 3 of the License, or
33  * (at your option) any later version.
34  *
35  * Grbl is distributed in the hope that it will be useful,
36  * but WITHOUT ANY WARRANTY; without even the implied warranty of
37  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38  * GNU General Public License for more details.
39  *
40  * You should have received a copy of the GNU General Public License
41  * along with Grbl. If not, see <http://www.gnu.org/licenses/>.
42  */
43 
44 #include "../inc/MarlinConfig.h"
45 
46 #include "planner.h"
47 #include "stepper/indirection.h"
48 #ifdef __AVR__
49  #include "speed_lookuptable.h"
50 #endif
51 
52 // Disable multiple steps per ISR
53 //#define DISABLE_MULTI_STEPPING
54 
55 //
56 // Estimate the amount of time the Stepper ISR will take to execute
57 //
58 
59 #ifdef CPU_32_BIT
60 
61  // The base ISR takes 792 cycles
62  #define ISR_BASE_CYCLES 792UL
63 
64  // Linear advance base time is 64 cycles
65  #if ENABLED(LIN_ADVANCE)
66  #define ISR_LA_BASE_CYCLES 64UL
67  #else
68  #define ISR_LA_BASE_CYCLES 0UL
69  #endif
70 
71  // S curve interpolation adds 40 cycles
72  #if ENABLED(S_CURVE_ACCELERATION)
73  #define ISR_S_CURVE_CYCLES 40UL
74  #else
75  #define ISR_S_CURVE_CYCLES 0UL
76  #endif
77 
78  // Stepper Loop base cycles
79  #define ISR_LOOP_BASE_CYCLES 4UL
80 
81  // To start the step pulse, in the worst case takes
82  #define ISR_START_STEPPER_CYCLES 13UL
83 
84  // And each stepper (start + stop pulse) takes in worst case
85  #define ISR_STEPPER_CYCLES 16UL
86 
87 #else
88 
89  // The base ISR takes 752 cycles
90  #define ISR_BASE_CYCLES 752UL
91 
92  // Linear advance base time is 32 cycles
93  #if ENABLED(LIN_ADVANCE)
94  #define ISR_LA_BASE_CYCLES 32UL
95  #else
96  #define ISR_LA_BASE_CYCLES 0UL
97  #endif
98 
99  // S curve interpolation adds 160 cycles
100  #if ENABLED(S_CURVE_ACCELERATION)
101  #define ISR_S_CURVE_CYCLES 160UL
102  #else
103  #define ISR_S_CURVE_CYCLES 0UL
104  #endif
105 
106  // Stepper Loop base cycles
107  #define ISR_LOOP_BASE_CYCLES 32UL
108 
109  // To start the step pulse, in the worst case takes
110  #define ISR_START_STEPPER_CYCLES 57UL
111 
112  // And each stepper (start + stop pulse) takes in worst case
113  #define ISR_STEPPER_CYCLES 88UL
114 
115 #endif
116 
117 // Add time for each stepper
118 #if HAS_X_STEP
119  #define ISR_START_X_STEPPER_CYCLES ISR_START_STEPPER_CYCLES
120  #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES
121 #else
122  #define ISR_START_X_STEPPER_CYCLES 0UL
123  #define ISR_X_STEPPER_CYCLES 0UL
124 #endif
125 #if HAS_Y_STEP
126  #define ISR_START_Y_STEPPER_CYCLES ISR_START_STEPPER_CYCLES
127  #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES
128 #else
129  #define ISR_START_Y_STEPPER_CYCLES 0UL
130  #define ISR_Y_STEPPER_CYCLES 0UL
131 #endif
132 #if HAS_Z_STEP
133  #define ISR_START_Z_STEPPER_CYCLES ISR_START_STEPPER_CYCLES
134  #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES
135 #else
136  #define ISR_START_Z_STEPPER_CYCLES 0UL
137  #define ISR_Z_STEPPER_CYCLES 0UL
138 #endif
139 
140 // E is always interpolated, even for mixing extruders
141 #define ISR_START_E_STEPPER_CYCLES ISR_START_STEPPER_CYCLES
142 #define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES
143 
144 // If linear advance is disabled, the loop also handles them
145 #if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER)
146  #define ISR_START_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_START_STEPPER_CYCLES))
147  #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES))
148 #else
149  #define ISR_START_MIXING_STEPPER_CYCLES 0UL
150  #define ISR_MIXING_STEPPER_CYCLES 0UL
151 #endif
152 
153 // Calculate the minimum time to start all stepper pulses in the ISR loop
154 #define MIN_ISR_START_LOOP_CYCLES (ISR_START_X_STEPPER_CYCLES + ISR_START_Y_STEPPER_CYCLES + ISR_START_Z_STEPPER_CYCLES + ISR_START_E_STEPPER_CYCLES + ISR_START_MIXING_STEPPER_CYCLES)
155 
156 // And the total minimum loop time, not including the base
157 #define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES)
158 
159 // Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate
160 #define _MIN_STEPPER_PULSE_CYCLES(N) _MAX(uint32_t((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N))
161 #if MINIMUM_STEPPER_PULSE
162  #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(uint32_t(MINIMUM_STEPPER_PULSE))
163 #elif HAS_DRIVER(LV8729)
164  #define MIN_STEPPER_PULSE_CYCLES uint32_t((((F_CPU) - 1) / 2000000) + 1) // 0.5µs, aka 500ns
165 #else
166  #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL)
167 #endif
168 
169 // Calculate the minimum ticks of the PULSE timer that must elapse with the step pulse enabled
170 // adding the "start stepper pulse" code section execution cycles to account for that not all
171 // pulses start at the beginning of the loop, so an extra time must be added to compensate so
172 // the last generated pulse (usually the extruder stepper) has the right length
173 #if HAS_DRIVER(LV8729) && MINIMUM_STEPPER_PULSE == 0
174  #define MIN_PULSE_TICKS ((((PULSE_TIMER_TICKS_PER_US) + 1) / 2) + ((MIN_ISR_START_LOOP_CYCLES) / uint32_t(PULSE_TIMER_PRESCALE)))
175 #else
176  #define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * uint32_t(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / uint32_t(PULSE_TIMER_PRESCALE)))
177 #endif
178 
179 // Calculate the extra ticks of the PULSE timer between step pulses
180 #define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS))
181 
182 // But the user could be enforcing a minimum time, so the loop time is
183 #define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + _MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES))
184 
185 // If linear advance is enabled, then it is handled separately
186 #if ENABLED(LIN_ADVANCE)
187 
188  // Estimate the minimum LA loop time
189  #if ENABLED(MIXING_EXTRUDER) // ToDo: ???
190  // HELP ME: What is what?
191  // Directions are set up for MIXING_STEPPERS - like before.
192  // Finding the right stepper may last up to MIXING_STEPPERS loops in get_next_stepper().
193  // These loops are a bit faster than advancing a bresenham counter.
194  // Always only one e-stepper is stepped.
195  #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES))
196  #else
197  #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES
198  #endif
199 
200  // And the real loop time
201  #define ISR_LA_LOOP_CYCLES _MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LA_LOOP_CYCLES)
202 
203 #else
204  #define ISR_LA_LOOP_CYCLES 0UL
205 #endif
206 
207 // Now estimate the total ISR execution time in cycles given a step per ISR multiplier
208 #define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + (ISR_LOOP_CYCLES) * (R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / (R))
209 
210 // The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz)
211 #define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(128))
212 #define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(64))
213 #define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(32))
214 #define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(16))
215 #define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(8))
216 #define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(4))
217 #define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(2))
218 #define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(1))
219 
220 // The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz)
221 #define MIN_STEP_ISR_FREQUENCY MAX_STEP_ISR_FREQUENCY_1X
222 
223 //
224 // Stepper class definition
225 //
226 class Stepper {
227 
228  public:
229 
230  #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN)
231  static bool separate_multi_axis;
232  #endif
233 
234  #if HAS_MOTOR_CURRENT_PWM
235  #ifndef PWM_MOTOR_CURRENT
236  #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT
237  #endif
238  static uint32_t motor_current_setting[3];
239  static bool initialized;
240  #endif
241 
242  private:
243 
244  static block_t* current_block; // A pointer to the block currently being traced
245 
246  static uint8_t last_direction_bits, // The next stepping-bits to be output
247  axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner
248 
249  static bool abort_current_block; // Signals to the stepper that current block should be aborted
250 
251  // Last-moved extruder, as set when the last movement was fetched from planner
252  #if EXTRUDERS < 2
253  static constexpr uint8_t last_moved_extruder = 0;
254  #elif DISABLED(MIXING_EXTRUDER)
255  static uint8_t last_moved_extruder;
256  #endif
257 
258  #if ENABLED(X_DUAL_ENDSTOPS)
259  static bool locked_X_motor, locked_X2_motor;
260  #endif
261  #if ENABLED(Y_DUAL_ENDSTOPS)
262  static bool locked_Y_motor, locked_Y2_motor;
263  #endif
264  #if Z_MULTI_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN)
265  static bool locked_Z_motor, locked_Z2_motor;
266  #endif
267  #if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS)
268  static bool locked_Z3_motor;
269  #endif
270 
271  static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks
272  static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call
273 
274  #if ENABLED(ADAPTIVE_STEP_SMOOTHING)
275  static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis
276  #else
277  static constexpr uint8_t oversampling_factor = 0;
278  #endif
279 
280  // Delta error variables for the Bresenham line tracer
281  static xyze_long_t delta_error;
282  static xyze_ulong_t advance_dividend;
283  static uint32_t advance_divisor,
284  step_events_completed, // The number of step events executed in the current block
285  accelerate_until, // The point from where we need to stop acceleration
286  decelerate_after, // The point from where we need to start decelerating
287  step_event_count; // The total event count for the current block
288 
289  #if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER)
290  static uint8_t stepper_extruder;
291  #else
292  static constexpr uint8_t stepper_extruder = 0;
293  #endif
294 
295  #if ENABLED(S_CURVE_ACCELERATION)
296  static int32_t bezier_A, // A coefficient in Bézier speed curve
297  bezier_B, // B coefficient in Bézier speed curve
298  bezier_C; // C coefficient in Bézier speed curve
299  static uint32_t bezier_F, // F coefficient in Bézier speed curve
300  bezier_AV; // AV coefficient in Bézier speed curve
301  #ifdef __AVR__
302  static bool A_negative; // If A coefficient was negative
303  #endif
304  static bool bezier_2nd_half; // If Bézier curve has been initialized or not
305  #endif
306 
307  static uint32_t nextMainISR; // time remaining for the next Step ISR
308  #if ENABLED(LIN_ADVANCE)
309  static uint32_t nextAdvanceISR, LA_isr_rate;
310  static uint16_t LA_current_adv_steps, LA_final_adv_steps, LA_max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early".
311  static int8_t LA_steps;
312  static bool LA_use_advance_lead;
313  #endif // LIN_ADVANCE
314 
315  static int32_t ticks_nominal;
316  #if DISABLED(S_CURVE_ACCELERATION)
317  static uint32_t acc_step_rate; // needed for deceleration start point
318  #endif
319 
320  //
321  // Exact steps at which an endstop was triggered
322  //
323  static xyz_long_t endstops_trigsteps;
324 
325  //
326  // Positions of stepper motors, in step units
327  //
328  static xyze_long_t count_position;
329 
330  //
331  // Current direction of stepper motors (+1 or -1)
332  //
333  static xyze_int8_t count_direction;
334 
335  public:
336 
337  //
338  // Constructor / initializer
339  //
340  Stepper() {};
341 
342  // Initialize stepper hardware
343  static void init();
344 
345  // Interrupt Service Routines
346 
347  // The ISR scheduler
348  static void isr();
349 
350  // The stepper pulse phase ISR
351  static void stepper_pulse_phase_isr();
352 
353  // The stepper block processing phase ISR
354  static uint32_t stepper_block_phase_isr();
355 
356  #if ENABLED(LIN_ADVANCE)
357  // The Linear advance stepper ISR
358  static uint32_t advance_isr();
359  #endif
360 
361  // Check if the given block is busy or not - Must not be called from ISR contexts
362  static bool is_block_busy(const block_t* const block);
363 
364  // Get the position of a stepper, in steps
365  static int32_t position(const AxisEnum axis);
366 
367  // Report the positions of the steppers, in steps
368  static void report_positions();
369 
370  // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
371  // to notify the subsystem that it is time to go to work.
372  static void wake_up();
373 
374  // Quickly stop all steppers
375  FORCE_INLINE static void quick_stop() { abort_current_block = true; }
376 
377  // The direction of a single motor
378  FORCE_INLINE static bool motor_direction(const AxisEnum axis) { return TEST(last_direction_bits, axis); }
379 
380  // The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same.
381  FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); }
382 
383  // The extruder associated to the last movement
385  return (0
386  #if EXTRUDERS > 1 && DISABLED(MIXING_EXTRUDER)
387  + last_moved_extruder
388  #endif
389  );
390  }
391 
392  // Handle a triggered endstop
393  static void endstop_triggered(const AxisEnum axis);
394 
395  // Triggered position of an axis in steps
396  static int32_t triggered_position(const AxisEnum axis);
397 
398  #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
399  static void digitalPotWrite(const int16_t address, const int16_t value);
400  static void digipot_current(const uint8_t driver, const int16_t current);
401  #endif
402 
403  #if HAS_MICROSTEPS
404  static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3);
405  static void microstep_mode(const uint8_t driver, const uint8_t stepping);
406  static void microstep_readings();
407  #endif
408 
409  #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN)
411  #endif
412  #if ENABLED(X_DUAL_ENDSTOPS)
413  FORCE_INLINE static void set_x_lock(const bool state) { locked_X_motor = state; }
414  FORCE_INLINE static void set_x2_lock(const bool state) { locked_X2_motor = state; }
415  #endif
416  #if ENABLED(Y_DUAL_ENDSTOPS)
417  FORCE_INLINE static void set_y_lock(const bool state) { locked_Y_motor = state; }
418  FORCE_INLINE static void set_y2_lock(const bool state) { locked_Y2_motor = state; }
419  #endif
420  #if Z_MULTI_ENDSTOPS || (ENABLED(Z_STEPPER_AUTO_ALIGN) && Z_MULTI_STEPPER_DRIVERS)
421  FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; }
422  FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; }
423  #endif
424  #if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS)
425  FORCE_INLINE static void set_z3_lock(const bool state) { locked_Z3_motor = state; }
426  #endif
427 
428  #if ENABLED(BABYSTEPPING)
429  static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
430  #endif
431 
432  #if HAS_MOTOR_CURRENT_PWM
433  static void refresh_motor_power();
434  #endif
435 
436  // Set the current position in steps
437  static inline void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) {
439  const bool was_enabled = STEPPER_ISR_ENABLED();
440  if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT();
441  _set_position(a, b, c, e);
442  if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT();
443  }
444  static inline void set_position(const xyze_long_t &abce) { set_position(abce.a, abce.b, abce.c, abce.e); }
445 
446  static inline void set_axis_position(const AxisEnum a, const int32_t &v) {
448 
449  #ifdef __AVR__
450  // Protect the access to the position. Only required for AVR, as
451  // any 32bit CPU offers atomic access to 32bit variables
452  const bool was_enabled = STEPPER_ISR_ENABLED();
453  if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT();
454  #endif
455 
456  count_position[a] = v;
457 
458  #ifdef __AVR__
459  // Reenable Stepper ISR
460  if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT();
461  #endif
462  }
463 
464  // Set direction bits for all steppers
465  static void set_directions();
466 
467  private:
468 
469  // Set the current position in steps
470  static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e);
471  FORCE_INLINE static void _set_position(const abce_long_t &spos) { _set_position(spos.a, spos.b, spos.c, spos.e); }
472 
473  FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) {
474  uint32_t timer;
475 
476  // Scale the frequency, as requested by the caller
477  step_rate <<= scale;
478 
479  uint8_t multistep = 1;
480  #if DISABLED(DISABLE_MULTI_STEPPING)
481 
482  // The stepping frequency limits for each multistepping rate
483  static const uint32_t limit[] PROGMEM = {
492  };
493 
494  // Select the proper multistepping
495  uint8_t idx = 0;
496  while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) {
497  step_rate >>= 1;
498  multistep <<= 1;
499  ++idx;
500  };
501  #else
502  NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
503  #endif
504  *loops = multistep;
505 
506  #ifdef CPU_32_BIT
507  // In case of high-performance processor, it is able to calculate in real-time
508  timer = uint32_t(STEPPER_TIMER_RATE) / step_rate;
509  #else
510  constexpr uint32_t min_step_rate = F_CPU / 500000U;
511  NOLESS(step_rate, min_step_rate);
512  step_rate -= min_step_rate; // Correct for minimal speed
513  if (step_rate >= (8 * 256)) { // higher step rate
514  const uint8_t tmp_step_rate = (step_rate & 0x00FF);
515  const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(step_rate >> 8)][0],
516  gain = (uint16_t)pgm_read_word(table_address + 2);
517  timer = MultiU16X8toH16(tmp_step_rate, gain);
518  timer = (uint16_t)pgm_read_word(table_address) - timer;
519  }
520  else { // lower step rates
521  uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0];
522  table_address += ((step_rate) >> 1) & 0xFFFC;
523  timer = (uint16_t)pgm_read_word(table_address)
524  - (((uint16_t)pgm_read_word(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3);
525  }
526  // (there is no need to limit the timer value here. All limits have been
527  // applied above, and AVR is able to keep up at 30khz Stepping ISR rate)
528  #endif
529 
530  return timer;
531  }
532 
533  #if ENABLED(S_CURVE_ACCELERATION)
534  static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av);
535  static int32_t _eval_bezier_curve(const uint32_t curr_step);
536  #endif
537 
538  #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
539  static void digipot_init();
540  #endif
541 
542  #if HAS_MICROSTEPS
543  static void microstep_init();
544  #endif
545 
546 };
547 
548 extern Stepper stepper;
pgm_read_word
#define pgm_read_word(addr)
Definition: pgmspace.h:101
X2_DIR_INIT
#define X2_DIR_INIT
Definition: indirection.h:109
planner.h
WITHIN
#define WITHIN(N, L, H)
Definition: macros.h:195
XYZval::z
T z
Definition: types.h:286
E3_DIR_INIT
#define E3_DIR_INIT
Definition: indirection.h:241
Y_ENABLE_ON
#define Y_ENABLE_ON
Definition: Configuration_A3ides_2209_MINI.h:927
SERIAL_CHAR
#define SERIAL_CHAR(x)
Definition: serial.h:69
Stepper::separate_multi_axis
static bool separate_multi_axis
Definition: stepper.h:231
MAX_STEP_ISR_FREQUENCY_4X
#define MAX_STEP_ISR_FREQUENCY_4X
Definition: stepper.h:216
endstops.h
direction
uint8_t direction
Definition: UsbCore.h:185
STEP_MULTIPLY
#define STEP_MULTIPLY(A, B)
Definition: stepper.cpp:1259
NOLESS
#define NOLESS(v, n)
Definition: macros.h:127
Planner::discard_current_block
static FORCE_INLINE void discard_current_block()
Definition: planner.h:820
X_MS3_PIN
#define X_MS3_PIN
Definition: pins.h:559
E5_DIR_INIT
#define E5_DIR_INIT
Definition: indirection.h:275
XYZEval
Definition: types.h:101
Stepper::report_positions
static void report_positions()
Definition: stepper.cpp:2276
XYZEval::z
T z
Definition: types.h:383
Planner::synchronize
static void synchronize()
Definition: planner.cpp:1556
temperature.h
INVERT_Y_STEP_PIN
#define INVERT_Y_STEP_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:501
MIN_STEP_ISR_FREQUENCY
#define MIN_STEP_ISR_FREQUENCY
Definition: stepper.h:221
mixer
Mixer mixer
Z_ENABLE_INIT
#define Z_ENABLE_INIT
Definition: indirection.h:86
block_t::flag
volatile uint8_t flag
Definition: planner.h:97
MSG_COUNT_X
#define MSG_COUNT_X
Definition: language.h:172
XYZval::x
T x
Definition: types.h:286
X2_MS1_PIN
#define X2_MS1_PIN
Definition: pins.h:989
Stepper::isr
static void isr()
Definition: stepper.cpp:1262
PULSE_TIMER_NUM
#define PULSE_TIMER_NUM
Definition: HAL.h:129
E3_MS2_PIN
#define E3_MS2_PIN
Definition: pins.h:610
PrintJobRecovery::info
static job_recovery_info_t info
Definition: power_loss_recovery.h:111
X2_ENABLE_WRITE
#define X2_ENABLE_WRITE(STATE)
Definition: indirection.h:105
Z_ENABLE_WRITE
#define Z_ENABLE_WRITE(STATE)
Definition: indirection.h:87
stepper.h
E5_ENABLE_INIT
#define E5_ENABLE_INIT
Definition: indirection.h:270
E5_MS1_PIN
#define E5_MS1_PIN
Definition: pins.h:625
ADDED_STEP_TICKS
#define ADDED_STEP_TICKS
Definition: stepper.h:180
L6470_Marlin::spi_abort
static volatile bool spi_abort
Definition: L6470_Marlin.h:44
Stepper::axis_is_moving
static FORCE_INLINE bool axis_is_moving(const AxisEnum axis)
Definition: stepper.h:381
PROGMEM
#define PROGMEM
Definition: pgmspace.h:29
E1_ENABLE_WRITE
#define E1_ENABLE_WRITE(STATE)
Definition: indirection.h:203
X2_STEP_INIT
#define X2_STEP_INIT
Definition: indirection.h:113
E1
Definition: L6470_Marlin.h:30
LOW
#define LOW
Definition: wiring_constants.h:70
INVERT_E_STEP_PIN
#define INVERT_E_STEP_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:503
indirection.h
X_AXIS
Definition: types.h:37
X_MS2_PIN
#define X_MS2_PIN
Definition: pins.h:556
PULSE_START
#define PULSE_START(AXIS)
Y_DIR_INIT
#define Y_DIR_INIT
Definition: indirection.h:74
MOTOR_CURRENT_PWM_E0_PIN
#define MOTOR_CURRENT_PWM_E0_PIN
Definition: pins_ARCHIM1.h:136
MSG_COUNT_A
#define MSG_COUNT_A
Definition: language.h:173
INVERT_X_DIR
#define INVERT_X_DIR
Definition: Configuration_A3ides_2209_MINI.h:948
E4_DIR_INIT
#define E4_DIR_INIT
Definition: indirection.h:258
stepper
Stepper stepper
Definition: stepper.cpp:82
E_ENABLE_ON
#define E_ENABLE_ON
Definition: Configuration_A3ides_2209_MINI.h:929
MAX_STEP_ISR_FREQUENCY_2X
#define MAX_STEP_ISR_FREQUENCY_2X
Definition: stepper.h:217
i2s_push_sample
void i2s_push_sample()
SERIAL_ECHOPAIR
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
E0_MS1_PIN
#define E0_MS1_PIN
Definition: pins.h:580
MOTOR_CURRENT_PWM_Y_PIN
#define MOTOR_CURRENT_PWM_Y_PIN
Definition: pins_ARCHIM1.h:134
MAX_STEP_ISR_FREQUENCY_128X
#define MAX_STEP_ISR_FREQUENCY_128X
Definition: stepper.h:211
E0
Definition: L6470_Marlin.h:30
C_AXIS
Definition: types.h:39
Stepper::set_z2_lock
static FORCE_INLINE void set_z2_lock(const bool state)
Definition: stepper.h:422
Stepper::is_block_busy
static bool is_block_busy(const block_t *const block)
Definition: stepper.cpp:1967
__attribute__
bool boolean __attribute__((deprecated))
Definition: wiring_constants.h:110
HAL_STEP_TIMER_ISR
HAL_STEP_TIMER_ISR()
Definition: stepper.cpp:1248
Stepper::motor_direction
static FORCE_INLINE bool motor_direction(const AxisEnum axis)
Definition: stepper.h:378
XYZEval::e
T e
Definition: types.h:383
Z_MS2_PIN
#define Z_MS2_PIN
Definition: pins.h:574
PULSE_STOP
#define PULSE_STOP(AXIS)
Z2_STEP_INIT
#define Z2_STEP_INIT
Definition: indirection.h:153
Z2_STEP_WRITE
#define Z2_STEP_WRITE(STATE)
Definition: indirection.h:155
babystep
Babystep babystep
Z3_ENABLE_WRITE
#define Z3_ENABLE_WRITE(STATE)
Definition: indirection.h:166
Stepper::init
static void init()
Definition: stepper.cpp:1992
SET_PWM
#define SET_PWM(IO)
Definition: fastio.h:103
i
uint8_t i
Definition: screen_test_graph.c:72
_MIN
#define _MIN(V...)
Definition: macros.h:333
Y
Definition: L6470_Marlin.h:30
Stepper
Definition: stepper.h:226
X_ENABLE_INIT
#define X_ENABLE_INIT
Definition: indirection.h:52
state
static volatile fsensor_t state
Definition: filament_sensor.c:23
AxisEnum
AxisEnum
Definition: types.h:36
Stepper::wake_up
static void wake_up()
Definition: stepper.cpp:342
Stepper::endstop_triggered
static void endstop_triggered(const AxisEnum axis)
Definition: stepper.cpp:2237
Z2_ENABLE_INIT
#define Z2_ENABLE_INIT
Definition: indirection.h:144
enable_Z
#define enable_Z()
Definition: Marlin.h:142
SET_OUTPUT
#define SET_OUTPUT(IO)
Definition: fastio.h:101
X_MS1_PIN
#define X_MS1_PIN
Definition: pins.h:553
X_ENABLE_ON
#define X_ENABLE_ON
Definition: Configuration_A3ides_2209_MINI.h:926
A
#define A(CODE)
Definition: macros.h:75
Z3_DIR_INIT
#define Z3_DIR_INIT
Definition: indirection.h:170
recovery
PrintJobRecovery recovery
motion.h
Z_MOVE_TEST
#define Z_MOVE_TEST
dac084s085::setValue
static void setValue(const uint8_t channel, const uint8_t value)
SERIAL_ECHOLN
#define SERIAL_ECHOLN(x)
Definition: serial.h:72
block_t::steps
abce_ulong_t steps
Definition: planner.h:107
X_ENABLE_WRITE
#define X_ENABLE_WRITE(STATE)
Definition: indirection.h:53
STEPPER_ISR_ENABLED
#define STEPPER_ISR_ENABLED()
Definition: HAL.h:143
Y_ENABLE_INIT
#define Y_ENABLE_INIT
Definition: indirection.h:69
INVERT_Z_STEP_PIN
#define INVERT_Z_STEP_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:502
STEP_TIMER_NUM
#define STEP_TIMER_NUM
Definition: HAL.h:127
HAL_timer_start
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t)
Definition: HAL.h:149
DIGIPOT_MOTOR_CURRENT
#define DIGIPOT_MOTOR_CURRENT
Definition: pins_RAMBO.h:113
Stepper::Stepper
Stepper()
Definition: stepper.h:340
L6470_Marlin::dir_commands
static uint8_t dir_commands[MAX_L6470]
Definition: L6470_Marlin.h:41
Stepper::set_axis_position
static void set_axis_position(const AxisEnum a, const int32_t &v)
Definition: stepper.h:446
E2_DIR_INIT
#define E2_DIR_INIT
Definition: indirection.h:224
E0_ENABLE_INIT
#define E0_ENABLE_INIT
Definition: indirection.h:185
cutter
SpindleLaser cutter
Definition: spindle_laser.cpp:33
E1_ENABLE_INIT
#define E1_ENABLE_INIT
Definition: indirection.h:202
Z
Definition: L6470_Marlin.h:30
MAX_L6470
Definition: L6470_Marlin.h:30
MOTOR_CURRENT_PWM_X_PIN
#define MOTOR_CURRENT_PWM_X_PIN
Definition: pins_ARCHIM1.h:133
NOMORE
#define NOMORE(v, n)
Definition: macros.h:133
X2_ENABLE_INIT
#define X2_ENABLE_INIT
Definition: indirection.h:104
Y_MS1_PIN
#define Y_MS1_PIN
Definition: pins.h:562
Z2_DIR_INIT
#define Z2_DIR_INIT
Definition: indirection.h:149
SPIClass::transfer
byte transfer(uint8_t _data, SPITransferMode _mode=SPI_LAST)
Definition: SPI.cpp:49
HAL_timer_isr_prologue
#define HAL_timer_isr_prologue(TIMER_NUM)
Definition: HAL.h:196
MOTOR_CURRENT_PWM_XY_PIN
#define MOTOR_CURRENT_PWM_XY_PIN
Definition: pins_HJC2560C_REV2.h:73
Stepper::movement_extruder
static FORCE_INLINE uint8_t movement_extruder()
Definition: stepper.h:384
X_DIR_READ
#define X_DIR_READ()
Definition: indirection.h:59
block_t::cutter_power
cutter_power_t cutter_power
Definition: planner.h:153
NORM_E_DIR
#define NORM_E_DIR(E)
Definition: indirection.h:396
DISABLE_ISRS
#define DISABLE_ISRS()
Definition: HAL.h:53
E2_MS3_PIN
#define E2_MS3_PIN
Definition: pins.h:604
E3_MS1_PIN
#define E3_MS1_PIN
Definition: pins.h:607
TFilamentMonitor::block_completed
static void block_completed(const block_t *const b)
Definition: runout.h:94
Z3_STEP_WRITE
#define Z3_STEP_WRITE(STATE)
Definition: indirection.h:176
E5_MS2_PIN
#define E5_MS2_PIN
Definition: pins.h:628
E1_MS1_PIN
#define E1_MS1_PIN
Definition: pins.h:589
FORCE_INLINE
#define FORCE_INLINE
Definition: macros.h:40
XYZEval::a
T a
Definition: types.h:384
block_t::position
abce_long_t position
Definition: planner.h:108
job_recovery_info_t::sdpos
volatile uint32_t sdpos
Definition: power_loss_recovery.h:97
XYZEval::c
T c
Definition: types.h:384
BLOCK_BIT_SYNC_POSITION
Definition: planner.h:76
L6470
L6470_Marlin L6470
Z_MS1_PIN
#define Z_MS1_PIN
Definition: pins.h:571
E5_ENABLE_WRITE
#define E5_ENABLE_WRITE(STATE)
Definition: indirection.h:271
Z3_ENABLE_INIT
#define Z3_ENABLE_INIT
Definition: indirection.h:165
Stepper::digipot_current
static void digipot_current(const uint8_t driver, const int16_t current)
Definition: stepper.cpp:2495
MOTOR_CURRENT_PWM_E1_PIN
#define MOTOR_CURRENT_PWM_E1_PIN
Definition: pins_ARCHIM1.h:137
Y_MS3_PIN
#define Y_MS3_PIN
Definition: pins.h:568
COUNT
#define COUNT(a)
Definition: macros.h:200
XYZEval::b
T b
Definition: types.h:384
E4_MS2_PIN
#define E4_MS2_PIN
Definition: pins.h:619
E4_ENABLE_WRITE
#define E4_ENABLE_WRITE(STATE)
Definition: indirection.h:254
MOTOR_CURRENT_PWM_Z_PIN
#define MOTOR_CURRENT_PWM_Z_PIN
Definition: pins_HJC2560C_REV2.h:74
E2_MS2_PIN
#define E2_MS2_PIN
Definition: pins.h:601
INVERT_X_STEP_PIN
#define INVERT_X_STEP_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:500
X_MOVE_TEST
#define X_MOVE_TEST
block_t::acceleration_rate
uint32_t acceleration_rate
Definition: planner.h:133
X_DIR_WRITE
#define X_DIR_WRITE(STATE)
Definition: indirection.h:58
ENABLE_STEPPER_DRIVER_INTERRUPT
#define ENABLE_STEPPER_DRIVER_INTERRUPT()
Definition: HAL.h:141
Stepper::set_directions
static void set_directions()
Definition: stepper.cpp:354
LOOP_L_N
#define LOOP_L_N(VAR, N)
Definition: types.h:58
X2_MS3_PIN
#define X2_MS3_PIN
Definition: pins.h:995
MAX_STEP_ISR_FREQUENCY_64X
#define MAX_STEP_ISR_FREQUENCY_64X
Definition: stepper.h:212
DISABLED
#define DISABLED(V...)
Definition: macros.h:178
block_t::final_rate
uint32_t final_rate
Definition: planner.h:147
E2_MS1_PIN
#define E2_MS1_PIN
Definition: pins.h:598
Z3_STEP_INIT
#define Z3_STEP_INIT
Definition: indirection.h:174
runout
FilamentMonitor runout
HAL_TIMER_TYPE_MAX
#define HAL_TIMER_TYPE_MAX
Definition: HAL.h:63
HAL_timer_get_count
#define HAL_timer_get_count(timer)
Definition: HAL.h:188
XY
#define XY
Definition: macros.h:28
cli
void cli()
Stepper::triggered_position
static int32_t triggered_position(const AxisEnum axis)
Definition: stepper.cpp:2258
Y2_ENABLE_WRITE
#define Y2_ENABLE_WRITE(STATE)
Definition: indirection.h:124
WRITE
#define WRITE(IO, V)
Definition: fastio.h:96
Stepper::microstep_ms
static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3)
Definition: stepper.cpp:2701
F_CPU
#define F_CPU
Definition: stm32_def.h:23
SERIAL_ECHOPGM
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
E2_ENABLE_INIT
#define E2_ENABLE_INIT
Definition: indirection.h:219
E0_DIR_INIT
#define E0_DIR_INIT
Definition: indirection.h:190
MINIMUM_STEPPER_PRE_DIR_DELAY
#define MINIMUM_STEPPER_PRE_DIR_DELAY
Definition: Conditionals_post.h:571
Stepper::digitalPotWrite
static void digitalPotWrite(const int16_t address, const int16_t value)
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
enable_X
#define enable_X()
Definition: Marlin.h:76
E0_MS2_PIN
#define E0_MS2_PIN
Definition: pins.h:583
createSpeedLookupTable.a
list a
Definition: createSpeedLookupTable.py:29
Stepper::quick_stop
static FORCE_INLINE void quick_stop()
Definition: stepper.h:375
enable_Y
#define enable_Y()
Definition: Marlin.h:103
X_DIR_INIT
#define X_DIR_INIT
Definition: indirection.h:57
SpindleLaser::apply_power
static void apply_power(const cutter_power_t inpow)
Definition: spindle_laser.cpp:64
L
#define L(CODE)
Definition: macros.h:76
Y2_STEP_INIT
#define Y2_STEP_INIT
Definition: indirection.h:132
Stepper::set_separate_multi_axis
static FORCE_INLINE void set_separate_multi_axis(const bool state)
Definition: stepper.h:410
Z_MS3_PIN
#define Z_MS3_PIN
Definition: pins.h:577
XYZEval::set
FI void set(const T px)
Definition: types.h:391
MIXER_STEPPER_LOOP
#define MIXER_STEPPER_LOOP(VAR)
Definition: mixing.h:68
MINIMUM_STEPPER_POST_DIR_DELAY
#define MINIMUM_STEPPER_POST_DIR_DELAY
Definition: Conditionals_post.h:566
SPIClass::begin
void begin(uint8_t _pin=CS_PIN_CONTROLLED_BY_USER)
Definition: SPI.cpp:43
Z_DIR_READ
#define Z_DIR_READ()
Definition: indirection.h:93
MultiU16X8toH16
static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2)
Definition: math.h:92
Y2_DIR_INIT
#define Y2_DIR_INIT
Definition: indirection.h:128
uint8_t
const uint8_t[]
Definition: 404_html.c:3
address
UsbDeviceAddress address
Definition: address.h:202
Stepper::stepper_pulse_phase_isr
static void stepper_pulse_phase_isr()
Definition: stepper.cpp:1397
block_t::direction_bits
uint8_t direction_bits
Definition: planner.h:136
DISABLE_STEPPER_DRIVER_INTERRUPT
#define DISABLE_STEPPER_DRIVER_INTERRUPT()
Definition: HAL.h:142
_BV
#define _BV(bit)
Definition: wiring_constants.h:99
INVERT_Y_DIR
#define INVERT_Y_DIR
Definition: Configuration_A3ides_2209_MINI.h:949
sei
void sei()
SET_CS5
#define SET_CS5(V)
Definition: fastio.h:228
X2_MS2_PIN
#define X2_MS2_PIN
Definition: pins.h:992
L6470_Marlin::spi_active
static bool spi_active
Definition: L6470_Marlin.h:45
XYZval::y
T y
Definition: types.h:286
block_t::initial_rate
uint32_t initial_rate
Definition: planner.h:147
Z_DIR_INIT
#define Z_DIR_INIT
Definition: indirection.h:91
MAX_STEP_ISR_FREQUENCY_1X
#define MAX_STEP_ISR_FREQUENCY_1X
Definition: stepper.h:218
E5_MS3_PIN
#define E5_MS3_PIN
Definition: pins.h:631
Stepper::set_position
static void set_position(const xyze_long_t &abce)
Definition: stepper.h:444
X2_STEP_WRITE
#define X2_STEP_WRITE(STATE)
Definition: indirection.h:115
MOTOR_CURRENT_PWM_E_PIN
#define MOTOR_CURRENT_PWM_E_PIN
Definition: pins_HJC2560C_REV2.h:75
SERIAL_ERROR_MSG
#define SERIAL_ERROR_MSG(S)
Definition: serial.h:184
E3_ENABLE_INIT
#define E3_ENABLE_INIT
Definition: indirection.h:236
Y_AXIS
Definition: types.h:38
Y_MS2_PIN
#define Y_MS2_PIN
Definition: pins.h:565
block_t::step_event_count
uint32_t step_event_count
Definition: planner.h:110
Z_STEP_WRITE
#define Z_STEP_WRITE(STATE)
Definition: indirection.h:97
E3_ENABLE_WRITE
#define E3_ENABLE_WRITE(STATE)
Definition: indirection.h:237
HAL_timer_isr_epilogue
#define HAL_timer_isr_epilogue(TIMER_NUM)
Definition: HAL.h:197
REV_E_DIR
#define REV_E_DIR(E)
Definition: indirection.h:397
E4_MS3_PIN
#define E4_MS3_PIN
Definition: pins.h:622
STEPPER_TIMER_TICKS_PER_US
#define STEPPER_TIMER_TICKS_PER_US
Definition: HAL.h:135
Y2_STEP_WRITE
#define Y2_STEP_WRITE(STATE)
Definition: indirection.h:134
E2_ENABLE_WRITE
#define E2_ENABLE_WRITE(STATE)
Definition: indirection.h:220
Z_AXIS
Definition: types.h:39
EXTRUDERS
#define EXTRUDERS
Definition: Configuration_A3ides_2209_MINI.h:148
E4_ENABLE_INIT
#define E4_ENABLE_INIT
Definition: indirection.h:253
pgm_read_dword
#define pgm_read_dword(addr)
Definition: pgmspace.h:105
A_AXIS
Definition: types.h:37
Mixer::get_next_stepper
static FORCE_INLINE uint8_t get_next_stepper()
Definition: mixing.h:248
E_STEP_WRITE
#define E_STEP_WRITE(E, V)
Definition: indirection.h:395
Stepper::microstep_mode
static void microstep_mode(const uint8_t driver, const uint8_t stepping)
Definition: stepper.cpp:2863
HIGH
#define HIGH
Definition: wiring_constants.h:71
E3_MS3_PIN
#define E3_MS3_PIN
Definition: pins.h:613
block_t::decelerate_after
uint32_t decelerate_after
Definition: planner.h:123
E4_MS1_PIN
#define E4_MS1_PIN
Definition: pins.h:616
Mixer::get_stepper
static FORCE_INLINE uint8_t get_stepper()
Definition: mixing.h:247
HAL_timer_set_compare
#define HAL_timer_set_compare(timer, compare)
Definition: HAL.h:186
SPI
SPIClass SPI
Definition: SPI.cpp:78
Y_STEP_WRITE
#define Y_STEP_WRITE(STATE)
Definition: indirection.h:80
E0_MS3_PIN
#define E0_MS3_PIN
Definition: pins.h:586
speed_lookuptable.h
Stepper::microstep_readings
static void microstep_readings()
Definition: stepper.cpp:2894
INVERT_Z_DIR
#define INVERT_Z_DIR
Definition: Configuration_A3ides_2209_MINI.h:950
block_t::nominal_rate
uint32_t nominal_rate
Definition: planner.h:147
MIXER_STEPPER_SETUP
#define MIXER_STEPPER_SETUP()
Definition: mixing.h:73
TEST
#define TEST(n, b)
Definition: macros.h:81
HAS_DRIVER
#define HAS_DRIVER(T)
Definition: drivers.h:74
DIGIPOTSS_PIN
#define DIGIPOTSS_PIN
Definition: pins_RAMBO.h:110
Y_DIR_WRITE
#define Y_DIR_WRITE(STATE)
Definition: indirection.h:75
DELAY_NS
#define DELAY_NS(x)
Definition: Delay.h:172
Endstops::update
static void update()
Definition: endstops.cpp:496
E_AXIS_INIT
#define E_AXIS_INIT(NUM)
Stepper::position
static int32_t position(const AxisEnum axis)
Definition: stepper.cpp:2214
Y2_ENABLE_INIT
#define Y2_ENABLE_INIT
Definition: indirection.h:123
hal_timer_t
#define hal_timer_t
Definition: timers.h:33
MAX_STEP_ISR_FREQUENCY_8X
#define MAX_STEP_ISR_FREQUENCY_8X
Definition: stepper.h:215
Y_ENABLE_WRITE
#define Y_ENABLE_WRITE(STATE)
Definition: indirection.h:70
Planner::get_current_block
static block_t * get_current_block()
Definition: planner.h:769
XYZval
Definition: types.h:100
Z_ENABLE_ON
#define Z_ENABLE_ON
Definition: Configuration_A3ides_2209_MINI.h:928
Y_MOVE_TEST
#define Y_MOVE_TEST
E0_ENABLE_WRITE
#define E0_ENABLE_WRITE(STATE)
Definition: indirection.h:186
E_AXIS
Definition: types.h:40
SET_STEP_DIR
#define SET_STEP_DIR(A)
Z2_ENABLE_WRITE
#define Z2_ENABLE_WRITE(STATE)
Definition: indirection.h:145
Y_DIR_READ
#define Y_DIR_READ()
Definition: indirection.h:76
B_AXIS
Definition: types.h:38
SBI
#define SBI(A, B)
Definition: macros.h:85
stepper
Stepper stepper
Definition: stepper.cpp:82
ENABLE_ISRS
#define ENABLE_ISRS()
Definition: HAL.h:52
Z_DIR_WRITE
#define Z_DIR_WRITE(STATE)
Definition: indirection.h:92
X
Definition: L6470_Marlin.h:30
createSpeedLookupTable.b
list b
Definition: createSpeedLookupTable.py:30
E1_MS2_PIN
#define E1_MS2_PIN
Definition: pins.h:592
DIGIPOT_CHANNELS
#define DIGIPOT_CHANNELS
Definition: pins_RAMBO.h:111
MAX_STEP_ISR_FREQUENCY_32X
#define MAX_STEP_ISR_FREQUENCY_32X
Definition: stepper.h:213
READ
#define READ(IO)
Definition: fastio.h:95
hal_timer_t
uint16_t hal_timer_t
Definition: HAL.h:62
block_t::accelerate_until
uint32_t accelerate_until
Definition: planner.h:123
block_t
Definition: planner.h:95
endstops
Endstops endstops
Definition: endstops.cpp:51
AXIS_INIT
#define AXIS_INIT(AXIS, PIN)
block_t::extruder
static constexpr uint8_t extruder
Definition: planner.h:115
E1_DIR_INIT
#define E1_DIR_INIT
Definition: indirection.h:207
Stepper::set_position
static void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e)
Definition: stepper.h:437
Stepper::set_z_lock
static FORCE_INLINE void set_z_lock(const bool state)
Definition: stepper.h:421
E1_MS3_PIN
#define E1_MS3_PIN
Definition: pins.h:595
X_STEP_WRITE
#define X_STEP_WRITE(STATE)
Definition: indirection.h:63
Stepper::stepper_block_phase_isr
static uint32_t stepper_block_phase_isr()
Definition: stepper.cpp:1541
planner
Planner planner
Definition: planner.cpp:111
MAX_STEP_ISR_FREQUENCY_16X
#define MAX_STEP_ISR_FREQUENCY_16X
Definition: stepper.h:214
STEPPER_TIMER_RATE
#define STEPPER_TIMER_RATE
Definition: HAL.h:133
MICROSTEP_MODES
#define MICROSTEP_MODES
Definition: Configuration_A3ides_2209_MINI_adv.h:656
MIN_PULSE_TICKS
#define MIN_PULSE_TICKS
Definition: stepper.h:176