mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 15:38:29 -04:00
Tools: powr_change.py also prints AccFlags changes
This commit is contained in:
parent
de1c2ed598
commit
c781897e52
@ -43,11 +43,14 @@ class POWRChange(object):
|
|||||||
break
|
break
|
||||||
if current is None:
|
if current is None:
|
||||||
current_flags = 0
|
current_flags = 0
|
||||||
|
current_accflags = 0
|
||||||
|
have_accflags = hasattr(m, "AccFlags")
|
||||||
else:
|
else:
|
||||||
current_flags = current.Flags
|
current_flags = current.Flags
|
||||||
|
if have_accflags:
|
||||||
|
current_accflags = current.AccFlags
|
||||||
|
|
||||||
flags = m.Flags
|
flags = m.Flags
|
||||||
if flags == current_flags:
|
|
||||||
continue
|
|
||||||
line = ""
|
line = ""
|
||||||
for bit in range(0, 32): # range?
|
for bit in range(0, 32): # range?
|
||||||
mask = 1 << bit
|
mask = 1 << bit
|
||||||
@ -58,6 +61,19 @@ class POWRChange(object):
|
|||||||
elif not new_bit_set and old_bit_set:
|
elif not new_bit_set and old_bit_set:
|
||||||
line += " -%s" % self.bit_description(bit)
|
line += " -%s" % self.bit_description(bit)
|
||||||
|
|
||||||
|
if have_accflags:
|
||||||
|
accflags = m.AccFlags
|
||||||
|
old_acc_bit_set = current_accflags & mask
|
||||||
|
new_acc_bit_set = accflags & mask
|
||||||
|
|
||||||
|
if new_acc_bit_set and not old_acc_bit_set:
|
||||||
|
line += " ACCFLAGS+%s" % self.bit_description(bit)
|
||||||
|
elif not new_bit_set and old_bit_set:
|
||||||
|
line += " ACCFLAGS-%s" % self.bit_description(bit)
|
||||||
|
|
||||||
|
if len(line) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
current = m
|
current = m
|
||||||
|
|
||||||
timestamp = getattr(m, '_timestamp', 0.0)
|
timestamp = getattr(m, '_timestamp', 0.0)
|
||||||
|
Loading…
Reference in New Issue
Block a user