Tools: enforce Values/Bitmask sanity check for vehicles as well as libraries

we have enforced this one-of-Values-or-Bitmask in libraries for a long time, and should have been enforcing it in vehicles before now.

MissionPlanner and MAVProxy ignore Values if Bitmask is present
This commit is contained in:
Peter Barker 2024-05-17 10:41:21 +10:00 committed by Peter Barker
parent 55b0c64b5a
commit 5cef031ce5

View File

@ -221,6 +221,10 @@ def process_vehicle(vehicle):
else:
error("param: unknown parameter metadata field '%s'" % field[0])
if (getattr(p, 'Values', None) is not None and
getattr(p, 'Bitmask', None) is not None):
error("Both @Values and @Bitmask present")
vehicle.params.append(p)
current_file = None
debug("Processed %u params" % len(vehicle.params))