Skip to content

Commit

Permalink
param: show unknown bits in bitmasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 27, 2023
1 parent b3b8a28 commit 4ac8c79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MAVProxy/modules/lib/param_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,18 @@ def param_info(self, param, value):
if not param in htree:
return None
help = htree[param]
remaining_bits = int(value)
try:
bitmask = self.get_bitmask_from_help(help)
if bitmask is not None:
v = []
for k in bitmask.keys():
if int(value) & (1<<int(k)):
v.append(bitmask[k])
remaining_bits &= ~(1<<int(k))
for i in range(31):
if remaining_bits & (1<<i):
v.append("Uknownbit%u" % i)
return '|'.join(v)
except Exception as e:
print(e)
Expand Down

0 comments on commit 4ac8c79

Please sign in to comment.