Skip to content

Commit

Permalink
tools, NRF51-post-build: Use paths to hex files
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
theotherjimmy committed Sep 27, 2018
1 parent 1f2e56b commit 3c03ac4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/targets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from copy import copy
from inspect import getmro
from collections import namedtuple, Mapping
from tools.resources import FileType
from tools.targets.LPC import patch
from tools.paths import TOOLS_BOOTLOADERS
from tools.utils import json_file_to_dict
Expand Down Expand Up @@ -481,7 +482,7 @@ def binary_hook(t_self, resources, _, binf):
sdf = None
for softdevice_and_offset_entry\
in t_self.target.EXPECTED_SOFTDEVICES_WITH_OFFSETS:
for hexf in resources.hex_files:
for hexf in resources.get_file_paths(FileType.HEX):
if hexf.find(softdevice_and_offset_entry['name']) != -1:
t_self.notify.debug("SoftDevice file found %s."
% softdevice_and_offset_entry['name'])
Expand All @@ -500,7 +501,7 @@ def binary_hook(t_self, resources, _, binf):
# override image
blf = None
if t_self.target.MERGE_BOOTLOADER is True:
for hexf in resources.hex_files:
for hexf in resources.get_file_paths(FileType.HEX):
if hexf.find(t_self.target.OVERRIDE_BOOTLOADER_FILENAME) != -1:
t_self.notify.debug("Bootloader file found %s."
% t_self.target.OVERRIDE_BOOTLOADER_FILENAME)
Expand Down

0 comments on commit 3c03ac4

Please sign in to comment.