Skip to content

Commit

Permalink
Re-do lost commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Jan 18, 2022
1 parent 95eee4e commit 3b7bdc1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyxcp/master/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def _generalized_downloader(
"""
"""
self.setMta(address)
minSt /= 10000.0 # Unit is 100μS.
minSt /= 10000.0
block_downloader = functools.partial(
self._block_downloader,
dl_func = dl_func,
Expand Down Expand Up @@ -719,10 +719,11 @@ def _block_downloader(self, data: bytes, dl_func = None, dl_next_func = None, mi
index = 0
for index in packets:
packet_data = data[offset : offset + max_packet_size]
last = (remaining_block_size - max_packet_size) == 0
if index == 0:
dl_func(packet_data, length) # Transmit the complete length in the first CTO.
dl_func(packet_data, length, last) # Transmit the complete length in the first CTO.
else:
dl_next_func(packet_data, remaining_block_size)
dl_next_func(packet_data, remaining_block_size, last)
offset += max_packet_size
remaining_block_size -= max_packet_size
delay(minSt)
Expand Down

0 comments on commit 3b7bdc1

Please sign in to comment.