summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-10-31 22:38:52 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-10-31 22:38:52 -0700
commit54f2b698ce48b37a63fc56a5e745c31901e131ba (patch)
treeedb75ebc160b2078fe96ad7d445766fc85bfde7a
parent3177e10e9e7b6ce720ca4cd0a952c884c876bcd6 (diff)
atmel-samd: remove infinite loop if USB MSC read fails.
-rw-r--r--ports/atmel-samd/usb_mass_storage.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ports/atmel-samd/usb_mass_storage.c b/ports/atmel-samd/usb_mass_storage.c
index 3e96c3787..c8301228c 100644
--- a/ports/atmel-samd/usb_mass_storage.c
+++ b/ports/atmel-samd/usb_mass_storage.c
@@ -309,8 +309,7 @@ void usb_msc_background(void) {
// Load more blocks from USB if they are needed.
if (active_nblocks > 0) {
int32_t result = mscdf_xfer_blocks(false, sector_buffer, 1);
- while (result != ERR_NONE) {}
- usb_busy = true;
+ usb_busy = result != ERR_NONE;
} else {
mscdf_xfer_blocks(false, NULL, 0);
active_write = false;