-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Further improvement to prevent potential LA related hang #25696
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EvilGremlin
pushed a commit
to EvilGremlin/Marlin
that referenced
this pull request
May 8, 2023
EvilGremlin
pushed a commit
to EvilGremlin/Marlin
that referenced
this pull request
May 17, 2023
tspiva
pushed a commit
to tspiva/Marlin
that referenced
this pull request
May 25, 2023
Andy-Big
pushed a commit
to Andy-Big/Marlin_FB_Reborn
that referenced
this pull request
Jul 14, 2023
queeup
added a commit
to queeup-Forks/Ender-3V3-SE
that referenced
this pull request
Oct 11, 2024
queeup
added a commit
to queeup-Forks/Ender-3V3-SE
that referenced
this pull request
Oct 11, 2024
buzzhuzz
pushed a commit
to buzzhuzz/Ender-3V3-SE
that referenced
this pull request
Oct 20, 2024
queeup
added a commit
to queeup-Forks/Ender-3V3-SE_Marlin
that referenced
this pull request
Oct 26, 2024
queeup
added a commit
to queeup-Forks/Ender-3V3-SE_Marlin
that referenced
this pull request
Oct 27, 2024
queeup
added a commit
to queeup-Forks/Ender-3V3-SE_Marlin
that referenced
this pull request
Nov 11, 2024
X-Stuff
pushed a commit
to X-Stuff/Ender-3V3-SE
that referenced
this pull request
Jan 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
#25557 fixed a problem where a division by zero in the 32 bit code for
Stepper::calc_timer_interval()
resulted inla_interval == 0
which caused an infinite loop in the stepper ISR.There remains a potential edge case where
Stepper::calc_timer_interval()
is passed a very lowstep_rate
which results in a return value that is larger than can fit intohal_timer_t
. In the very edgiest case it could even be a number that truncates to zero when converted to typehal_timer_t
, also causing a hang. But even in the more general edge case it will result in a smaller value forla_interval
than is correct.This PR introduces an analogy to the 8 bit code which tests for
min_step_rate
and returns a fixed large number ifstep_rate
is too small.In addition, whilst working on this, I realised that if
la_interval
ends up being a large number (becausestep_rate
is really low) then the E steps will freeze untilla_interval
has expired. Butstep_rate
will only ever be really low momentarily (at the point where the E stepper reverses during a deceleration ramp due to linear advance). Long beforela_interval
has expired, it will receive a new, smaller value which should be honoured to avoid missed E steps. So there is a correction for this as well.Requirements
Enable
LIN_ADVANCE
.Benefits
Removes a potential edge case hang and potential lost E steps.
Related Issues
#25553
#25557