Skip to content

Commit

Permalink
USB mass storage: use correct blocking behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicgs committed Feb 27, 2018
1 parent 5fa4772 commit 3a6dccb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions USBMassStorage.py
Expand Up @@ -275,7 +275,7 @@ def handle_read(self, cbw):
# something in 'response' and letting the end of the switch send
for block_num in range(num_blocks):
data = self.disk_image.get_sector_data(base_lba + block_num)
self.ep_to_host.send(data)
self.ep_to_host.send_packet(data, blocking=True)

if self.verbose > 3:
print("--> responded with {} bytes".format(cbw.data_transfer_length))
Expand Down Expand Up @@ -344,7 +344,7 @@ def handle_data_available(self, data):
print("--> responding with", len(response),
"bytes [{}], status={}".format(bytes_as_hex(response), status))

self.ep_to_host.send(response)
self.ep_to_host.send_packet(response, blocking=True)

# Otherwise, respond with our status.
csw = bytes([
Expand All @@ -354,7 +354,7 @@ def handle_data_available(self, data):
status
])

self.ep_to_host.send(csw)
self.ep_to_host.send_packet(csw, blocking=True)


class CommandBlockWrapper:
Expand Down

0 comments on commit 3a6dccb

Please sign in to comment.