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

Projects
None yet
3 participants
@digitalentity
Copy link
Member

commented Apr 24, 2018

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 Apr 24, 2018

@fiam

fiam approved these changes Apr 26, 2018

Copy link
Member

left a comment

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 {

This comment has been minimized.

Copy link
@fiam

fiam Apr 26, 2018

Member

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

@giacomo892

This comment has been minimized.

Copy link
Collaborator

commented Apr 26, 2018

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

@digitalentity

This comment has been minimized.

Copy link
Member Author

commented Apr 26, 2018

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

@digitalentity digitalentity merged commit 58b9e8a into development Apr 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@digitalentity digitalentity deleted the de_sbus_refactor branch Apr 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.