Skip to content

Commit

Permalink
Move to ftMotion_stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 8, 2024
1 parent 8885933 commit a132919
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 1 addition & 7 deletions Marlin/src/HAL/ESP32/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,7 @@ void stepperTask(void *parameter) {
#if ENABLED(FT_MOTION)

if (using_ftMotion) {
if (!nextMainISR) {
stepper.ftMotion_stepper();
IF_DISABLED(ENDSTOP_INTERRUPTS_FEATURE, endstops.update()); // Check endstops now
TERN_(BABYSTEPPING, if (babystep.has_steps()) stepper.babystepping_isr());
}
else
i2s_push_sample();
if (!nextMainISR) stepper.ftMotion_stepper();
nextMainISR = 0;
}

Expand Down
10 changes: 8 additions & 2 deletions Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,8 +1511,6 @@ void Stepper::isr() {
if (!nextMainISR) { // Main ISR is ready to fire during this iteration?
nextMainISR = FTM_MIN_TICKS; // Set to minimum interval (a limit on the top speed)
ftMotion_stepper(); // Run FTM Stepping
IF_DISABLED(ENDSTOP_INTERRUPTS_FEATURE, endstops.update()); // Check endstops now
TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr()); // Babystep if needed
}
interval = nextMainISR; // Interval is either some old nextMainISR or FTM_MIN_TICKS
nextMainISR = 0; // For FT Motion fire again ASAP
Expand Down Expand Up @@ -3493,6 +3491,8 @@ void Stepper::report_positions() {
U_APPLY_STEP(axis_did_move.u, false), V_APPLY_STEP(axis_did_move.v, false), W_APPLY_STEP(axis_did_move.w, false)
);

TERN_(I2S_STEPPER_STREAM, i2s_push_sample());

// Begin waiting for the minimum pulse duration
START_TIMED_PULSE();

Expand Down Expand Up @@ -3534,6 +3534,12 @@ void Stepper::report_positions() {
U_APPLY_STEP(!STEP_STATE_U, false), V_APPLY_STEP(!STEP_STATE_V, false), W_APPLY_STEP(!STEP_STATE_W, false)
);

// Check endstops on every step
IF_DISABLED(ENDSTOP_INTERRUPTS_FEATURE, endstops.update());

// Also handle babystepping here
TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr());

} // Stepper::ftMotion_stepper

void Stepper::ftMotion_blockQueueUpdate() {
Expand Down

0 comments on commit a132919

Please sign in to comment.