DFReader: Fix some missing bitmask info in dump verbose#947
Merged
peterbarker merged 1 commit intoArduPilot:masterfrom Jun 1, 2024
Merged
DFReader: Fix some missing bitmask info in dump verbose#947peterbarker merged 1 commit intoArduPilot:masterfrom
peterbarker merged 1 commit intoArduPilot:masterfrom
Conversation
Contributor
|
Merged, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following #937, I noticed a few things with bitmask displays that wasn't quite behaving, which this PR aims to fix:
1/ The bits of ArmChecks are not being displayed when doing
dump --verbose ARMThis was because these bits have no description, and the
except KeyErrordoes not catch this.Fixed by using if
hasattr(bit, 'description')instead.2/ The last bit was always missing (e.g. CHANGED bit on POWR.Flags)
This was because
for i in range(bit_offset)needs a+1.Actually I realised this should rather be using
highest_bit+1in case more bits are set than defined.3/ If any bit is missing a definition from the XML, then this and subsequent bit are not shown
This was because
bangvariable was being used undefined in this case.Fixed by defining
bangearlier, so it is available in either case.I have also aligned the "!" to be spaced out consistently with how TLOGs and MavProxy show these things.
Tested with a number of examples:
ARM now showing bits:
POWR now showing last bit:
And by removing the bits except USING_SIGNING from the MAV definition in my local .pymavlink/LogMessages/Plane.xml file: