From 10d868efa4a9f2f44e86d609991617a77b262114 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 13 Jun 2016 17:45:28 +0300 Subject: [PATCH] Update build script for mbed framework --- platformio/builder/scripts/frameworks/mbed.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 0f6399e2..55b9fe14 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -71,7 +71,7 @@ MBED_VARIANTS = { "samr21_xpro": "SAMR21G18A", "saml21_xpro_b": "SAML21J18A", "samd21_xpro": "SAMD21J18A", - "bbcmicrobit": "NRF51822" + "bbcmicrobit": "NRF51_MICROBIT" } MBED_LIBS_MAP = { @@ -149,6 +149,18 @@ def add_mbedlib(libname, libar): if (not any(f.endswith(".h") for f in files) and basename(root) not in sysincdirs): continue + + target_includes = ( + "TARGET_%s" % env.get( + "BOARD_OPTIONS", {}).get("vendor", "").upper(), + "TARGET_%s" % variant, + "TARGET_CORTEX_M" + ) + + if "TARGET_" in root: + if all([p not in root.upper() for p in target_includes]): + continue + var_dir = join("$BUILD_DIR", "FrameworkMbed%sInc%d" % (libname.upper(), crc32(root))) if var_dir in env.get("CPPPATH"):