Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added extra_labels_add checking to script and cleaned up a missed device.h file #1859

Merged
merged 1 commit into from
Jun 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions hal/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
@@ -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
*
Expand All @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions workspace_tools/remove-device-h.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down