Skip to content

Commit 00f9347

Browse files
theotherjimmyadbridge
authored andcommitted
tools, NRF51-post-build: Use paths to hex files
### Description The NRF51 post build hook finds it's hex files using the Resources object. This PR fixes the corner case where the hex files within a project have a name!=path (This really only happens online). ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Breaking change
1 parent 8346498 commit 00f9347

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/targets/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from copy import copy
2626
from inspect import getmro
2727
from collections import namedtuple, Mapping
28+
from tools.resources import FileType
2829
from tools.targets.LPC import patch
2930
from tools.paths import TOOLS_BOOTLOADERS
3031
from tools.utils import json_file_to_dict
@@ -481,7 +482,7 @@ def binary_hook(t_self, resources, _, binf):
481482
sdf = None
482483
for softdevice_and_offset_entry\
483484
in t_self.target.EXPECTED_SOFTDEVICES_WITH_OFFSETS:
484-
for hexf in resources.hex_files:
485+
for hexf in resources.get_file_paths(FileType.HEX):
485486
if hexf.find(softdevice_and_offset_entry['name']) != -1:
486487
t_self.notify.debug("SoftDevice file found %s."
487488
% softdevice_and_offset_entry['name'])
@@ -500,7 +501,7 @@ def binary_hook(t_self, resources, _, binf):
500501
# override image
501502
blf = None
502503
if t_self.target.MERGE_BOOTLOADER is True:
503-
for hexf in resources.hex_files:
504+
for hexf in resources.get_file_paths(FileType.HEX):
504505
if hexf.find(t_self.target.OVERRIDE_BOOTLOADER_FILENAME) != -1:
505506
t_self.notify.debug("Bootloader file found %s."
506507
% t_self.target.OVERRIDE_BOOTLOADER_FILENAME)

0 commit comments

Comments
 (0)