Skip to content

Commit 25ba021

Browse files
authored
Merge pull request #3578 from theotherjimmy/inherit-target-labels
Target system - Inherit names from target parents
2 parents 17e9131 + 290d7de commit 25ba021

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

targets/targets.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@
336336
"default_lib": "small",
337337
"release_versions": ["2"]
338338
},
339-
"LPC4088": {
339+
"MCU_LPC4088": {
340340
"inherits": ["LPCTarget"],
341341
"core": "Cortex-M4F",
342342
"extra_labels": ["NXP", "LPC408X"],
@@ -346,11 +346,14 @@
346346
"function": "LPC4088Code.binary_hook"
347347
},
348348
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "DEBUG_AWARENESS", "ERROR_PATTERN", "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
349-
"release_versions": ["2", "5"],
350349
"device_name": "LPC4088FBD144"
351350
},
351+
"LPC4088": {
352+
"inherits": ["MCU_LPC4088"],
353+
"release_versions": ["2", "5"]
354+
},
352355
"LPC4088_DM": {
353-
"inherits": ["LPC4088"],
356+
"inherits": ["MCU_LPC4088"],
354357
"release_versions": ["2", "5"]
355358
},
356359
"LPC4330_M4": {

tools/targets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import shutil
2222
import inspect
2323
import sys
24+
from copy import copy
2425
from collections import namedtuple
2526
from tools.patch import patch
2627
from tools.paths import TOOLS_BOOTLOADERS
@@ -276,7 +277,10 @@ def program_cycle_s(self):
276277
@property
277278
def labels(self):
278279
"""Get all possible labels for this target"""
279-
labels = [self.name] + CORE_LABELS[self.core] + self.extra_labels
280+
names = copy(self.resolution_order_names)
281+
if "Target" in names:
282+
names.remove("Target")
283+
labels = (names + CORE_LABELS[self.core] + self.extra_labels)
280284
# Automatically define UVISOR_UNSUPPORTED if the target doesn't
281285
# specifically define UVISOR_SUPPORTED
282286
if "UVISOR_SUPPORTED" not in labels:

0 commit comments

Comments
 (0)