-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
…l handling of SBUS2 data if necessary
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.
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.
src/main/rx/sbus_channels.c
Outdated
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 { |
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'd remove this else since you have a return in the preceding if.
Tested on the bench with a non FrSky receiver. Works. |
I suppose we can merge it now. I've tested with multiple receivers, all seem to work just fine. |
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