Stabilize macro ordering in mbed_config.h

pull/7646/head
Jimmy Brisson 2018-07-30 11:05:32 -05:00
parent 28064f1319
commit fb42bb0439
1 changed files with 8 additions and 4 deletions

View File

@ -1124,10 +1124,14 @@ class Config(object):
Config._check_required_parameters(params)
params_with_values = [p for p in params.values() if p.value is not None]
ctx = {
"cfg_params" : [(p.macro_name, str(p.value), p.set_by)
for p in params_with_values],
"macros": [(m.macro_name, str(m.macro_value or ""), m.defined_by)
for m in macros.values()],
"cfg_params": sorted([
(p.macro_name, str(p.value), p.set_by)
for p in params_with_values
]),
"macros": sorted([
(m.macro_name, str(m.macro_value or ""), m.defined_by)
for m in macros.values()
]),
"name_len": max([len(m.macro_name) for m in macros.values()] +
[len(m.macro_name) for m in params_with_values]
+ [0]),