mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-12-29 02:40:41 -07:00
👷 Add optimal stepper.set_e_position() (#27293)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
cdea1b8460
commit
94ce0d24d6
3 changed files with 18 additions and 1 deletions
|
|
@ -3192,7 +3192,7 @@ void Planner::set_position_mm(const xyze_pos_t &xyze) {
|
|||
if (has_blocks_queued())
|
||||
buffer_sync_block(BLOCK_BIT_SYNC_POSITION);
|
||||
else
|
||||
stepper.set_axis_position(E_AXIS, position.e);
|
||||
stepper.set_e_position(position.e);
|
||||
}
|
||||
|
||||
#endif // HAS_EXTRUDERS
|
||||
|
|
|
|||
|
|
@ -3407,6 +3407,18 @@ void Stepper::set_axis_position(const AxisEnum a, const int32_t &v) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
|
||||
void Stepper::set_e_position(const int32_t &v) {
|
||||
planner.synchronize();
|
||||
|
||||
AVR_ATOMIC_SECTION_START();
|
||||
count_position.e = v;
|
||||
AVR_ATOMIC_SECTION_END();
|
||||
}
|
||||
|
||||
#endif // HAS_EXTRUDERS
|
||||
|
||||
#if ENABLED(FT_MOTION)
|
||||
|
||||
void Stepper::ftMotion_syncPosition() {
|
||||
|
|
|
|||
|
|
@ -540,6 +540,11 @@ class Stepper {
|
|||
static void set_position(const xyze_long_t &spos);
|
||||
static void set_axis_position(const AxisEnum a, const int32_t &v);
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
// Save a little when E is the only one used
|
||||
static void set_e_position(const int32_t &v);
|
||||
#endif
|
||||
|
||||
// Report the positions of the steppers, in steps
|
||||
static void report_a_position(const xyz_long_t &pos);
|
||||
static void report_positions();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue