Skip to content
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

Improve timer vs task priority check #6717

Merged
merged 1 commit into from
Oct 27, 2024
Merged

Conversation

KevinOConnor
Copy link
Collaborator

@KevinOConnor KevinOConnor commented Oct 23, 2024

Rename sched_tasks_busy() to sched_check_set_tasks_busy() and change it to only return true if tasks are active (running or requested) for two consecutive calls. This makes it less likely that timers will yield to tasks except when tasks really are notably backlogged.

This also makes it less likely that multiple steppers controlling the same rail will be interrupted by tasks mid-step. This should slightly improve the timing, and make it less likely that a halt during homing/probing will occur with these steppers taking a different number of total steps.

This was discussed at: https://klipper.discourse.group/t/z-stepper-microstep-shift-on-multi-mcu-homing-loadcell-ldc1612/19524/

-Kevin

@KevinOConnor KevinOConnor force-pushed the work-schedprio-20241023 branch 2 times, most recently from 4f23669 to d597361 Compare October 24, 2024 00:56
@garethky
Copy link
Contributor

Tested on the Voron 2.4 with the Load Cell code that is similarly impacted. Verified to work.

Rename sched_tasks_busy() to sched_check_set_tasks_busy() and change
it to only return true if tasks are active (running or requested) for
two consecutive calls.  This makes it less likely that timers will
yield to tasks except when tasks really are notably backlogged.

This also makes it less likely that multiple steppers controlling the
same rail will be interrupted by tasks mid-step.  This should slightly
improve the timing, and make it less likely that a halt during
homing/probing will occur with these steppers taking a different
number of total steps.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
@KevinOConnor KevinOConnor merged commit ea546c7 into master Oct 27, 2024
2 checks passed
@KevinOConnor KevinOConnor deleted the work-schedprio-20241023 branch October 27, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants