generate_params.py: fix bitmask param type

This commit is contained in:
Beat Küng 2021-11-24 10:49:50 +01:00 committed by Daniel Agar
parent 5bcc5d3a13
commit 81cef522fd
1 changed files with 8 additions and 1 deletions

View File

@ -110,6 +110,13 @@ def parse_yaml_parameters_config(yaml_config, ethernet_supported):
param_type = 'INT32'
for key in param['values']:
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
elif param['type'] == 'bitmask':
param_type = 'INT32'
for key in param['bit']:
tags += '\n * @bit {:} {:}'.format(key, param['bit'][key])
max_val = max(key for key in param['bit'])
tags += '\n * @min 0'
tags += '\n * @max {:}'.format((1<<(max_val+1)) - 1)
elif param['type'] == 'boolean':
param_type = 'INT32'
tags += '\n * @boolean'
@ -120,7 +127,7 @@ def parse_yaml_parameters_config(yaml_config, ethernet_supported):
else:
raise Exception("unknown param type {:}".format(param['type']))
for tag in ['decimal', 'increment', 'category', 'volatile', 'bit',
for tag in ['decimal', 'increment', 'category', 'volatile',
'min', 'max', 'unit', 'reboot_required']:
if tag in param:
tags += '\n * @{:} {:}'.format(tag, param[tag])