diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 777fc49..0e5b8b6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -32,3 +32,4 @@ In the order of appearance in the commit history: | Issam E. Maghni | @concatime | | Patrik Bachan | @diggit | | - | @lweyrich1 | +| Michal Mlodecki | @TheColector | diff --git a/pylink/jlink.py b/pylink/jlink.py index 8ef21ba..a12387d 100644 --- a/pylink/jlink.py +++ b/pylink/jlink.py @@ -2269,11 +2269,11 @@ def flash_file(self, path, addr, on_progress=None, power_on=False): pass # Program the target. - bytes_flashed = self._dll.JLINK_DownloadFile(os.fsencode(path), addr) - if bytes_flashed < 0: - raise errors.JLinkFlashException(bytes_flashed) + res = self._dll.JLINK_DownloadFile(os.fsencode(path), addr) + if res < 0: + raise errors.JLinkFlashException(res) - return bytes_flashed + return res @connection_required def reset(self, ms=0, halt=True):