Skip to content

Commit 186f406

Browse files
authored
Merge pull request #4366 from theotherjimmy/dedupe-nordic
Move duplicated analogin and pwmout to NRF52 directory
2 parents 4635493 + 897667d commit 186f406

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

targets/targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@
26282628
"inherits": ["Target"],
26292629
"core": "Cortex-M4F",
26302630
"macros": ["NRF52", "TARGET_NRF52832", "BLE_STACK_SUPPORT_REQD", "SOFTDEVICE_PRESENT", "S132", "CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\""],
2631-
"extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5", "SDK11"],
2631+
"extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5", "SDK11", "NRF52_COMMON"],
26322632
"OUTPUT_EXT": "hex",
26332633
"is_disk_virtual": true,
26342634
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
@@ -2708,7 +2708,7 @@
27082708
"inherits": ["Target"],
27092709
"core": "Cortex-M4F",
27102710
"macros": ["TARGET_NRF52840", "BLE_STACK_SUPPORT_REQD", "SOFTDEVICE_PRESENT", "S140", "NRF_SD_BLE_API_VERSION=5", "NRF52840_XXAA", "NRF_DFU_SETTINGS_VERSION=1", "NRF_SD_BLE_API_VERSION=5", "CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\""],
2711-
"extra_labels": ["NORDIC", "MCU_NRF52840", "NRF5", "SDK13"],
2711+
"extra_labels": ["NORDIC", "MCU_NRF52840", "NRF5", "SDK13", "NRF52_COMMON"],
27122712
"OUTPUT_EXT": "hex",
27132713
"is_disk_virtual": true,
27142714
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],

tools/export/makefile/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def generate(self):
111111
for key in ['include_paths', 'library_paths', 'hex_files',
112112
'to_be_compiled']:
113113
ctx[key] = sorted(ctx[key])
114-
ctx.update(self.flags)
114+
ctx.update(self.format_flags())
115115

116116
for templatefile in \
117117
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
@@ -128,6 +128,17 @@ def generate(self):
128128
else:
129129
raise NotSupportedException("This make tool is in development")
130130

131+
def format_flags(self):
132+
"""Format toolchain flags for Makefile"""
133+
flags = {}
134+
for k, v in self.flags.iteritems():
135+
if k in ['asm_flags', 'c_flags', 'cxx_flags']:
136+
flags[k] = map(lambda x: x.replace('"', '\\"'), v)
137+
else:
138+
flags[k] = v
139+
140+
return flags
141+
131142
@staticmethod
132143
def build(project_name, log_name="build_log.txt", cleanup=True):
133144
""" Build Make project """

tools/export/uvision/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def format_flags(self):
166166
# Flag is invalid if set in template
167167
# Optimizations are also set in the template
168168
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
169-
flags['c_flags'] = [flag for flag in c_flags if not invalid_flag(flag)]
169+
flags['c_flags'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
170170
flags['c_flags'] = " ".join(flags['c_flags'])
171171
return flags
172172

0 commit comments

Comments
 (0)