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

Clean up the box identification code to use a table #223

Merged
merged 1 commit into from Apr 29, 2016

Conversation

dustin
Copy link
Contributor

@dustin dustin commented Apr 27, 2016

I've not tested this on hardware yet, but when I was doing some work in flight modes, it seemed that this structure simplified things a bit.


This change is Reviewable

@ShikOfTheRa
Copy link
Owner

yep - like structs.

its forced to enable though? Assume from testing and can be removed?
I think its only used by very old multiwii and Hariki now?

@dustin
Copy link
Contributor Author

dustin commented Apr 28, 2016

Yes, it's for testing. I didn't get a good test last night due to hardware
problems.

It seemed like a good idea for reporting modes. I did notice the limited
use. How are modes such as acro plus discovered in general?

On Thu, Apr 28, 2016, 04:40 ShikOfTheRa notifications@github.com wrote:

yep - like structs.

its forced to enable though? Assume from testing and can be removed?
I think its only used by very old multiwii and Hariki now?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#223 (comment)

@ShikOfTheRa
Copy link
Owner

BOXNAMES is still valid approach, but is the older way. CF,BF and multiwii now all use BOXID

MSP_BOXID
Basically the FC send a series of 8 bit values which represents the various modes in use. It varies between FC depending upon version and what is in use.
The order defines the bit used to flag when a sensor is enabled.
It was done this way to enable future expansion of modes without impacting MSP compatibility.

MSP status
Within this is a 32 bit value (MwSensorActive) that specifies which sensors/modes are enabled or not
This is the one used to determine if a mode is enabled or not by a bitwise OR with the different modes to see if they are enabled.

The trick is to understand how boxid works then it all becomes straightforward!

@ShikOfTheRa ShikOfTheRa merged commit 29db8b6 into ShikOfTheRa:master Apr 29, 2016
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.

None yet

2 participants