From a38910b3819e0ad533d054a9bc4aa01e8be06f10 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Tue, 14 Jun 2016 13:00:51 +0300 Subject: [PATCH] Improve include selection for mbed boards with a custom vendor --- platformio/builder/scripts/frameworks/mbed.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 55b9fe14..64d269af 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -145,18 +145,24 @@ def add_mbedlib(libname, libar): "lwip-sys" ) + target_map = { + "nxplpc": "NXP", + "freescalekinetis": "Freescale", + "ststm32": "STM" + } + + target_includes = ( + "TARGET_%s" % target_map.get( + env.get("BOARD_OPTIONS", {}).get("platform", ""), ""), + "TARGET_%s" % variant, + "TARGET_CORTEX_M" + ) + for root, _, files in walk(lib_dir): 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