|
31 | 31 | help='Ethernet support')
|
32 | 32 | parser.add_argument('--board', type=str, action='store',
|
33 | 33 | help='board name, e.g. ')
|
| 34 | +parser.add_argument('--board-with-io', dest='board_with_io', action='store_true', |
| 35 | + help='Indicate that the board as an IO for extra PWM', |
| 36 | + default=False) |
34 | 37 | parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
|
35 | 38 | help='Verbose Output')
|
36 | 39 |
|
|
40 | 43 | params_output_file = args.params_file
|
41 | 44 | timer_config_file = args.timer_config
|
42 | 45 | ethernet_supported = args.ethernet
|
| 46 | +board_with_io = args.board_with_io |
43 | 47 | board = args.board
|
44 | 48 |
|
45 | 49 | root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../..")
|
46 | 50 | output_functions_file = os.path.join(root_dir,"src/lib/mixer_module/output_functions.yaml")
|
47 | 51 |
|
48 | 52 | def process_param_prefix(param_prefix):
|
49 |
| - if param_prefix == '${PWM_FMU_OR_HIL}': |
50 |
| - if board == 'px4_sitl': return 'PWM_FMU' |
| 53 | + if param_prefix == '${PWM_MAIN_OR_HIL}': |
| 54 | + if board == 'px4_sitl': return 'PWM_MAIN' |
51 | 55 | return 'HIL_ACT'
|
| 56 | + if param_prefix == '${PWM_MAIN_OR_AUX}': |
| 57 | + if board_with_io: return 'PWM_AUX' |
| 58 | + return 'PWM_MAIN' |
52 | 59 | if '${' in param_prefix:
|
53 | 60 | raise Exception('unhandled variable in {:}'.format(param_prefix))
|
54 | 61 | return param_prefix
|
55 | 62 |
|
56 | 63 | def process_channel_label(channel_label):
|
57 |
| - if channel_label == '${PWM_FMU_OR_HIL}': |
| 64 | + if channel_label == '${PWM_MAIN_OR_HIL}': |
58 | 65 | if board == 'px4_sitl': return 'PWM Sim'
|
59 | 66 | return 'HIL actuator'
|
| 67 | + if channel_label == '${PWM_MAIN_OR_AUX}': |
| 68 | + if board_with_io: return 'PWM Aux' |
| 69 | + return 'PWM Main' |
60 | 70 | if '${' in channel_label:
|
61 | 71 | raise Exception('unhandled variable in {:}'.format(channel_label))
|
62 | 72 | return channel_label
|
@@ -171,9 +181,8 @@ def add_local_param(param_name, param_def):
|
171 | 181 | # We do this by extending the output_groups list and parse in a later iteration
|
172 | 182 | if 'generator' in group:
|
173 | 183 | if group['generator'] == 'pwm':
|
174 |
| - # We might set these depending on presence of IO in build... |
175 | 184 | param_prefix = process_param_prefix(group['param_prefix'])
|
176 |
| - channel_labels = group['channel_labels'] |
| 185 | + channel_labels = [process_channel_label(label) for label in group['channel_labels']] |
177 | 186 | standard_params = group.get('standard_params', [])
|
178 | 187 | extra_function_groups = group.get('extra_function_groups', [])
|
179 | 188 | pwm_timer_param = group.get('pwm_timer_param', None)
|
|
0 commit comments