Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 3cba043

Browse files
authored
Merge pull request #378 from tista3/master
Faster delete of uicr/mbr addresses from loaded hex
2 parents 0dda8d6 + 1d43383 commit 3cba043

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

nordicsemi/dfu/nrfhex.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,11 @@ def __init__(self, source, bootloader=None, arch=None):
8585

8686
def _removeuicr(self):
8787
uicr_start_address = 0x10000000
88-
maxaddress = self.maxaddr()
89-
if maxaddress >= uicr_start_address:
90-
for i in range(uicr_start_address, maxaddress + 1):
91-
self._buf.pop(i, 0)
88+
self._buf = {k: v for k, v in self._buf.items() if k < uicr_start_address}
9289

9390
def _removembr(self):
9491
mbr_end_address = 0x1000
95-
minaddress = super().minaddr()
96-
if minaddress < mbr_end_address:
97-
for i in range(minaddress, mbr_end_address):
98-
self._buf.pop(i, 0)
92+
self._buf = {k: v for k, v in self._buf.items() if k >= mbr_end_address}
9993

10094
def address_has_magic_number(self, address):
10195
try:

0 commit comments

Comments
 (0)