Skip to content

Commit

Permalink
Merge pull request #1859 from theotherjimmy/device-h-to-target-json
Browse files Browse the repository at this point in the history
added extra_labels_add checking to script and cleaned up a missed device.h file
  • Loading branch information
0xc0170 committed Jun 6, 2016
2 parents 0d3c835 + 32075c3 commit 88fbfac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
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

0 comments on commit 88fbfac

Please sign in to comment.