From 32075c38e4b02b92ac9f8e2b1df9f0ce2d74da23 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Mon, 6 Jun 2016 10:18:25 -0500 Subject: [PATCH] added extra_labels_add checking to script and moved a previously missed device.h file to targets.json --- hal/targets.json | 9 +++++--- .../TARGET_NRF51822_MKIT/device.h | 23 ++----------------- workspace_tools/remove-device-h.py | 2 ++ 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/hal/targets.json b/hal/targets.json index f8efebea6c6..c350588efc6 100644 --- a/hal/targets.json +++ b/hal/targets.json @@ -1173,17 +1173,20 @@ "inherits": ["MCU_NRF51_16K"], "progen": {"target": "mkit"}, "extra_labels_add": ["NRF51822", "NRF51822_MKIT"], - "macros_add": ["TARGET_NRF51822_MKIT"] + "macros_add": ["TARGET_NRF51822_MKIT"], + "features": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"] }, "NRF51822_BOOT": { "inherits": ["MCU_NRF51_16K_BOOT"], "extra_labels_add": ["NRF51822", "NRF51822_MKIT"], - "macros_add": ["TARGET_NRF51822_MKIT"] + "macros_add": ["TARGET_NRF51822_MKIT"], + "features": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"] }, "NRF51822_OTA": { "inherits": ["MCU_NRF51_16K_OTA"], "extra_labels_add": ["NRF51822", "NRF51822_MKIT"], - "macros_add": ["TARGET_NRF51822_MKIT"] + "macros_add": ["TARGET_NRF51822_MKIT"], + "features": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"] }, "ARCH_BLE": { "supported_form_factors": ["ARDUINO"], diff --git a/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_MKIT/device.h b/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_MKIT/device.h index 9d5a5e2109e..17cccb19bf6 100644 --- a/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_MKIT/device.h +++ b/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_MKIT/device.h @@ -1,3 +1,5 @@ +// The 'provides' section in 'target.json' is now used to create the device's hardware preprocessor switches. +// Check the 'provides' section of the target description in 'targets.json' for more details. /* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * @@ -16,41 +18,20 @@ #ifndef MBED_DEVICE_H #define MBED_DEVICE_H -#define DEVICE_PORTIN 1 -#define DEVICE_PORTOUT 1 -#define DEVICE_PORTINOUT 1 -#define DEVICE_INTERRUPTIN 1 -#define DEVICE_ANALOGIN 1 -#define DEVICE_ANALOGOUT 0 -#define DEVICE_SERIAL 1 -#define DEVICE_I2C 1 -#define DEVICE_I2CSLAVE 0 -#define DEVICE_SPI 1 -#define DEVICE_SPISLAVE 1 -#define DEVICE_CAN 0 -#define DEVICE_RTC 0 -#define DEVICE_ETHERNET 0 -#define DEVICE_PWMOUT 1 -#define DEVICE_SEMIHOST 0 -#define DEVICE_LOCALFILESYSTEM 0 -#define DEVICE_SLEEP 1 -#define DEVICE_DEBUG_AWARENESS 0 -#define DEVICE_STDIO_MESSAGES 0 -#define DEVICE_ERROR_PATTERN 1 #include "objects.h" diff --git a/workspace_tools/remove-device-h.py b/workspace_tools/remove-device-h.py index 19500f772f0..3b7b4f58d86 100644 --- a/workspace_tools/remove-device-h.py +++ b/workspace_tools/remove-device-h.py @@ -144,6 +144,8 @@ def add_to_targets(targets, device_file, verbose=False, remove=False) : for key, value in targets.iteritems() : for alt in value['extra_labels'] if 'extra_labels' in value else [] : if stem_match(device, alt) : possible_matches.add(key) + for alt in value['extra_labels_add'] if 'extra_labels_add' in value else [] : + if stem_match(device, alt) : possible_matches.add(key) possible_matches = list(possible_matches) for match in possible_matches : if device == match : possible_matches = [match]