Merge pull request #4366 from theotherjimmy/dedupe-nordic

Move duplicated analogin and pwmout to NRF52 directory
pull/4383/head
Martin Kojtal 2017-05-24 13:30:27 +01:00 committed by GitHub
commit 186f406c24
5 changed files with 15 additions and 4 deletions

View File

@ -2628,7 +2628,7 @@
"inherits": ["Target"],
"core": "Cortex-M4F",
"macros": ["NRF52", "TARGET_NRF52832", "BLE_STACK_SUPPORT_REQD", "SOFTDEVICE_PRESENT", "S132", "CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\""],
"extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5", "SDK11"],
"extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5", "SDK11", "NRF52_COMMON"],
"OUTPUT_EXT": "hex",
"is_disk_virtual": true,
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
@ -2708,7 +2708,7 @@
"inherits": ["Target"],
"core": "Cortex-M4F",
"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\""],
"extra_labels": ["NORDIC", "MCU_NRF52840", "NRF5", "SDK13"],
"extra_labels": ["NORDIC", "MCU_NRF52840", "NRF5", "SDK13", "NRF52_COMMON"],
"OUTPUT_EXT": "hex",
"is_disk_virtual": true,
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],

View File

@ -111,7 +111,7 @@ class Makefile(Exporter):
for key in ['include_paths', 'library_paths', 'hex_files',
'to_be_compiled']:
ctx[key] = sorted(ctx[key])
ctx.update(self.flags)
ctx.update(self.format_flags())
for templatefile in \
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
@ -128,6 +128,17 @@ class Makefile(Exporter):
else:
raise NotSupportedException("This make tool is in development")
def format_flags(self):
"""Format toolchain flags for Makefile"""
flags = {}
for k, v in self.flags.iteritems():
if k in ['asm_flags', 'c_flags', 'cxx_flags']:
flags[k] = map(lambda x: x.replace('"', '\\"'), v)
else:
flags[k] = v
return flags
@staticmethod
def build(project_name, log_name="build_log.txt", cleanup=True):
""" Build Make project """

View File

@ -166,7 +166,7 @@ class Uvision(Exporter):
# Flag is invalid if set in template
# Optimizations are also set in the template
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
flags['c_flags'] = [flag for flag in c_flags if not invalid_flag(flag)]
flags['c_flags'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
flags['c_flags'] = " ".join(flags['c_flags'])
return flags