forked from pybricks/pybricks-micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pbio/motor_process: catch up timer if behind
This adds an extra check to make sure the motor poll timer hasn't fallen too far behind. Before this change, if calling the motor process was blocked for too long, it would cause the motor contiki process to never yield until the wall clock caught up. This would also cause motor updates to be called with a time delta of 0 which probably caused unexpected conditions in some of the calculations. We can avoid this by checking to see if we have a condition that would trigger the unwanted behavior and reset the timer to a larger interval. This could cause a hiccup in the observer calculations but is a significant improvement over the alternative. Fixes: pybricks/support#1035
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
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
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
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