From 1e8392730d13834b50d465c87cefc0be71842cff Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 1 Mar 2018 09:53:16 +0000 Subject: [PATCH] Handle libusb_control_transfer errors from dfu_upload --- host/xmosdfu/xmosdfu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/host/xmosdfu/xmosdfu.cpp b/host/xmosdfu/xmosdfu.cpp index a0aca676..52199198 100644 --- a/host/xmosdfu/xmosdfu.cpp +++ b/host/xmosdfu/xmosdfu.cpp @@ -311,6 +311,11 @@ int read_dfu_image(char *file) { break; } + else if (numBytes < 0) + { + fprintf(stderr,"dfu_upload error (%d)\n", numBytes); + break; + } fwrite(block_data, 1, block_size, outFile); block_count++; }