Skip to content

Commit cfda78d

Browse files
committed
Exporters uvision - fix timestamp - asm does not like decimal point
The mbed time build stamp is with decimal point, which is causing ASM to fail, with strange command error. As a workaround, we truncate the number when exporting to uvision.
1 parent 7e650da commit cfda78d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

workspace_tools/export/uvision4.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ def generate(self):
6262

6363
project_data['tool_specific'] = {}
6464
project_data['tool_specific'].update(tool_specific)
65+
# armasm does not like floating numbers in macros, timestamp to int
66+
i = 0
67+
for macro in project_data['common']['macros']:
68+
if macro.startswith('MBED_BUILD_TIMESTAMP'):
69+
timestamp = macro[len('MBED_BUILD_TIMESTAMP='):]
70+
project_data['common']['macros'][i] = 'MBED_BUILD_TIMESTAMP=' + str(int(float(timestamp)))
71+
break
72+
i += 1
6573
project_data['common']['macros'].append('__ASSERT_MSG')
6674
self.progen_gen_file('uvision', project_data)
6775

0 commit comments

Comments
 (0)