Skip to content

Commit

Permalink
waf: process Cx SITL defaults on configure
Browse files Browse the repository at this point in the history
SW-241
  • Loading branch information
robertlong13 committed Jun 28, 2024
1 parent 724018a commit e914a08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tools/Carbonix_scripts/process_sitl_defaults.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8

'''
Build SITL default parameter files for use with SITL launcher
'''
Expand Down
20 changes: 20 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,26 @@ def configure(cfg):
if cfg.options.board is None:
cfg.options.board = 'sitl'

if cfg.options.board == 'sitl':
# Loop through all .parm files in libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/sitl_params/
param_folder = 'libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/sitl_params/'
for file in os.listdir(param_folder):
if not file.endswith('.parm'):
continue

# make build/sitl directory if it doesn't exist
if not os.path.exists('build'):
os.makedirs('build')
if not os.path.exists('build/sitl'):
os.makedirs('build/sitl')

in_file = os.path.join(param_folder, file)
out_file = os.path.join('build/sitl', file)

# Call Tools/Carbonix_scripts/process_sitl_defaults.py $in_file $out_file
cfg.msg('Processing default parameters', file)
subprocess.run(['Tools/Carbonix_scripts/process_sitl_defaults.py', in_file, out_file])

boards_names = boards.get_boards_names()
if not cfg.options.board in boards_names:
for b in boards_names:
Expand Down

0 comments on commit e914a08

Please sign in to comment.