-
Notifications
You must be signed in to change notification settings - Fork 18.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
HAL_ChibiOS: fixed cork/push #29521
HAL_ChibiOS: fixed cork/push #29521
Conversation
ensure that period[] array is not updated until we push
if (corked) { | ||
// when corked we put the updated period in a separate array which is | ||
// copied to period[] when we push | ||
period_corked[chan] = period_us; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean shouldn't this always be the case? Couldn't you just assert on the non-corked case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there could be special cases where we write non-corked, for something going into 4.6.0 I wouldn't want to rule out non-corked output on some weird vehicle setup
one example would be ReplayGyroFFT
another in toy_mode test code
for 4.7.0 I'd be happy to enforce corked only, starting with SITL
So the problem is that the period[] array was read by the dshot_send function and values were sent out before the push? Does the memcpy create any tearing problems? Should read see the pre-push or post-push value? It wasn't involved in the issue was it? |
Once corked, no updates should be seen until push has been called. so read should see the post-pushed or pre-corked values |
We could also remove the output here:
So the value is not written to the hal. |
Briefly tested on my fast rate quad without issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
ensure that period[] array is not updated until we push
this fixes the stuttering motors on tilt quadplanes, and may fix other issues
this is an alternative to #29518