Skip to content

Commit 88fbfac

Browse files
committed
Merge pull request #1859 from theotherjimmy/device-h-to-target-json
added extra_labels_add checking to script and cleaned up a missed device.h file
2 parents 0d3c835 + 32075c3 commit 88fbfac

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

hal/targets.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,17 +1173,20 @@
11731173
"inherits": ["MCU_NRF51_16K"],
11741174
"progen": {"target": "mkit"},
11751175
"extra_labels_add": ["NRF51822", "NRF51822_MKIT"],
1176-
"macros_add": ["TARGET_NRF51822_MKIT"]
1176+
"macros_add": ["TARGET_NRF51822_MKIT"],
1177+
"features": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"]
11771178
},
11781179
"NRF51822_BOOT": {
11791180
"inherits": ["MCU_NRF51_16K_BOOT"],
11801181
"extra_labels_add": ["NRF51822", "NRF51822_MKIT"],
1181-
"macros_add": ["TARGET_NRF51822_MKIT"]
1182+
"macros_add": ["TARGET_NRF51822_MKIT"],
1183+
"features": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"]
11821184
},
11831185
"NRF51822_OTA": {
11841186
"inherits": ["MCU_NRF51_16K_OTA"],
11851187
"extra_labels_add": ["NRF51822", "NRF51822_MKIT"],
1186-
"macros_add": ["TARGET_NRF51822_MKIT"]
1188+
"macros_add": ["TARGET_NRF51822_MKIT"],
1189+
"features": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"]
11871190
},
11881191
"ARCH_BLE": {
11891192
"supported_form_factors": ["ARDUINO"],

hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_MKIT/device.h

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// The 'provides' section in 'target.json' is now used to create the device's hardware preprocessor switches.
2+
// Check the 'provides' section of the target description in 'targets.json' for more details.
13
/* mbed Microcontroller Library
24
* Copyright (c) 2006-2013 ARM Limited
35
*
@@ -16,41 +18,20 @@
1618
#ifndef MBED_DEVICE_H
1719
#define MBED_DEVICE_H
1820

19-
#define DEVICE_PORTIN 1
20-
#define DEVICE_PORTOUT 1
21-
#define DEVICE_PORTINOUT 1
2221

23-
#define DEVICE_INTERRUPTIN 1
2422

25-
#define DEVICE_ANALOGIN 1
26-
#define DEVICE_ANALOGOUT 0
2723

28-
#define DEVICE_SERIAL 1
2924

30-
#define DEVICE_I2C 1
31-
#define DEVICE_I2CSLAVE 0
3225

33-
#define DEVICE_SPI 1
34-
#define DEVICE_SPISLAVE 1
3526

36-
#define DEVICE_CAN 0
3727

38-
#define DEVICE_RTC 0
3928

40-
#define DEVICE_ETHERNET 0
4129

42-
#define DEVICE_PWMOUT 1
4330

44-
#define DEVICE_SEMIHOST 0
45-
#define DEVICE_LOCALFILESYSTEM 0
4631

47-
#define DEVICE_SLEEP 1
4832

49-
#define DEVICE_DEBUG_AWARENESS 0
5033

51-
#define DEVICE_STDIO_MESSAGES 0
5234

53-
#define DEVICE_ERROR_PATTERN 1
5435

5536
#include "objects.h"
5637

workspace_tools/remove-device-h.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def add_to_targets(targets, device_file, verbose=False, remove=False) :
144144
for key, value in targets.iteritems() :
145145
for alt in value['extra_labels'] if 'extra_labels' in value else [] :
146146
if stem_match(device, alt) : possible_matches.add(key)
147+
for alt in value['extra_labels_add'] if 'extra_labels_add' in value else [] :
148+
if stem_match(device, alt) : possible_matches.add(key)
147149
possible_matches = list(possible_matches)
148150
for match in possible_matches :
149151
if device == match : possible_matches = [match]

0 commit comments

Comments
 (0)