Skip to content

Commit fb42bb0

Browse files
committed
Stabilize macro ordering in mbed_config.h
1 parent 28064f1 commit fb42bb0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/config/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,10 +1124,14 @@ def config_to_header(config, fname=None):
11241124
Config._check_required_parameters(params)
11251125
params_with_values = [p for p in params.values() if p.value is not None]
11261126
ctx = {
1127-
"cfg_params" : [(p.macro_name, str(p.value), p.set_by)
1128-
for p in params_with_values],
1129-
"macros": [(m.macro_name, str(m.macro_value or ""), m.defined_by)
1130-
for m in macros.values()],
1127+
"cfg_params": sorted([
1128+
(p.macro_name, str(p.value), p.set_by)
1129+
for p in params_with_values
1130+
]),
1131+
"macros": sorted([
1132+
(m.macro_name, str(m.macro_value or ""), m.defined_by)
1133+
for m in macros.values()
1134+
]),
11311135
"name_len": max([len(m.macro_name) for m in macros.values()] +
11321136
[len(m.macro_name) for m in params_with_values]
11331137
+ [0]),

0 commit comments

Comments
 (0)