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

Refactor SBUS handling code (potential race condition fixed) #3110

Merged
merged 4 commits into from
Apr 26, 2018

Conversation

digitalentity
Copy link
Member

Make S.Bus data updates atomic. Intoroduce better buffer handling (don't wait until timeout to start next frame reception). Could be a fix for #2981

@digitalentity digitalentity added this to the 2.0 milestone Apr 24, 2018
@digitalentity digitalentity requested a review from fiam April 24, 2018 14:12
Copy link
Member

@fiam fiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working fine on the bench. I don't have any objections to merge it as is, but it should be flight tested before it goes into a release.

if (channels->flags & SBUS_FLAG_FAILSAFE_ACTIVE) {
// internal failsafe enabled and rx failsafe flag set
// RX *should* still be sending valid channel data, so use it.
return RX_FRAME_COMPLETE | RX_FRAME_FAILSAFE;
}

return RX_FRAME_COMPLETE;
else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove this else since you have a return in the preceding if.

@giacomo892
Copy link
Collaborator

Tested on the bench with a non FrSky receiver. Works.

@digitalentity
Copy link
Member Author

I suppose we can merge it now. I've tested with multiple receivers, all seem to work just fine.

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.

3 participants