Add option for supplying custom init function name
Note that this only applies to the runnable in the generated yaml file. Change-Id: I4f6ac188bcfdeddddb390b9627b7cbddcd6456ad
This commit is contained in:
parent
1f388f1d2d
commit
4e53b9818a
powertrain_build
tests/zone_controller
@ -263,6 +263,10 @@ class BuildProjConfig:
|
||||
"""Return the relative composition arxml path."""
|
||||
return self._prj_cfg['ProjectInfo']['compositionArxml']
|
||||
|
||||
def get_custom_yaml_init_function_name(self):
|
||||
"""Return the custom yaml init function name."""
|
||||
return self._prj_cfg['ProjectInfo'].get('customYamlInitFunctionName')
|
||||
|
||||
def get_gen_ext_impl_type(self):
|
||||
"""Return the generate external implementation type."""
|
||||
return self._prj_cfg['ProjectInfo'].get('generateExternalImplementationType', True)
|
||||
|
@ -357,7 +357,9 @@ class CompositionYaml(ProblemLogger):
|
||||
swc_name = self.build_cfg.get_swc_name()
|
||||
autosar_prefix = "AR_"
|
||||
swc_prefix = self.build_cfg.get_scheduler_prefix()
|
||||
init_function = autosar_prefix + swc_prefix + "VcExtINI"
|
||||
custom_init_function = self.build_cfg.get_custom_yaml_init_function_name()
|
||||
standard_init_function = autosar_prefix + swc_prefix + "VcExtINI"
|
||||
init_function = custom_init_function if custom_init_function is not None else standard_init_function
|
||||
calibration_variables = list(self.cal_class_info["autosar"]["class_info"].keys())
|
||||
swc_content = {init_function: {"type": "INIT", "accesses": calibration_variables}}
|
||||
|
||||
|
@ -51,6 +51,7 @@ class TestCompositionYaml(unittest.TestCase):
|
||||
self.build_cfg.get_swc_name = MagicMock(return_value="testName_SC")
|
||||
self.build_cfg.get_swc_template = MagicMock(return_value="ARTCSC")
|
||||
self.build_cfg.get_swc_base = MagicMock(return_value="QM")
|
||||
self.build_cfg.get_custom_yaml_init_function_name = MagicMock(return_value=None)
|
||||
self.build_cfg.get_gen_ext_impl_type = MagicMock(return_value=True)
|
||||
self.build_cfg.get_code_generation_config = MagicMock(return_value=False)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user