From 06dc7fbb1e85f63e5aa092cb5656ea7627a3ad01 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Mon, 31 Jul 2017 10:27:30 -0300 Subject: USBH: testhal MSD: abort read on error --- testhal/STM32/STM32F4xx/USB_HOST/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/main.c b/testhal/STM32/STM32F4xx/USB_HOST/main.c index 215b9ec..44210a3 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/main.c +++ b/testhal/STM32/STM32F4xx/USB_HOST/main.c @@ -374,7 +374,8 @@ start: usbDbgPrintf("BLK: Raw read test (%dMB, %dB blocks)", RAW_READ_SZ_MB, sizeof(fbuff)); st = chVTGetSystemTime(); for (j = 0; j < NITERATIONS; j++) { - blkRead(&MSBLKD[0], start, fbuff, NBLOCKS); + if (blkRead(&MSBLKD[0], start, fbuff, NBLOCKS) != HAL_SUCCESS) + goto start; start += NBLOCKS; } et = chVTGetSystemTime(); -- cgit v1.2.3