HAL_ChibiOS: allow for a defaults.parm file in hwdef directory

this keeps defaults with the board, where that is appropriate
This commit is contained in:
Andrew Tridgell 2018-03-05 09:22:59 +11:00
parent 6e5cbc7c3d
commit a9edbb6b2d
1 changed files with 7 additions and 0 deletions

View File

@ -966,6 +966,13 @@ def build_peripheral_list():
def write_env_py(filename):
'''write out env.py for environment variables to control the build process'''
# see if board has a defaults.parm file
defaults_filename = os.path.join(os.path.dirname(args.hwdef), 'defaults.parm')
if os.path.exists(defaults_filename):
print("Adding defaults.parm")
env_vars['DEFAULT_PARAMETERS'] = os.path.abspath(defaults_filename)
# CHIBIOS_BUILD_FLAGS is passed to the ChibiOS makefile
env_vars['CHIBIOS_BUILD_FLAGS'] = ' '.join(build_flags)
pickle.dump(env_vars, open(filename, "wb"))