Tools: param_metadata: disallow @Values and @Bitmask at same time

This commit is contained in:
Peter Barker 2021-06-22 13:17:46 +10:00 committed by Andrew Tridgell
parent bf80c44408
commit eda7dff54d
1 changed files with 4 additions and 0 deletions

View File

@ -276,6 +276,10 @@ def process_library(vehicle, library, pathprefix=None):
value = re.sub('@PREFIX@', library.name, field[2])
setattr(p, field[0], value)
if (getattr(p, 'Values', None) is not None and
getattr(p, 'Bitmask', None) is not None):
error("Both @Values and @Bitmask present")
if (getattr(p, 'Values', None) is None and
getattr(p, 'Bitmask', None) is None):
# values and Bitmask available for this vehicle