From f014b8da68f162bb06ca88acf0085382a76d8dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 26 Feb 2019 22:38:30 +0000 Subject: Fixes for USB MSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix return value on succesfull scsi_requestsense. - Fix calls to LL SMT32 API for OTG2. - Port changes from ChibiOS fatfs_diskio. - Rework checks to allow simultaneous use of SD Card and USB MSD. Signed-off-by: José Simões --- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 4 ++-- os/hal/src/usbh/hal_usbh_msd.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'os/hal') diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index 3298c20..192b008 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1505,8 +1505,8 @@ static void _usbh_start(USBHDriver *usbh) { #endif { /* OTG HS clock enable and reset.*/ - rccEnableOTG_HS(TRUE); // Enable HS clock when cpu is in sleep mode - rccDisableOTG_HSULPI(TRUE); // Disable HS ULPI clock when cpu is in sleep mode + rccEnableOTG_HS(FALSE); // Disable HS clock when cpu is in sleep mode + rccDisableOTG_HSULPI(); rccResetOTG_HS(); otgp->GINTMSK = 0; diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c index fe97ff0..3d57934 100644 --- a/os/hal/src/usbh/hal_usbh_msd.c +++ b/os/hal/src/usbh/hal_usbh_msd.c @@ -516,6 +516,8 @@ static msd_result_t _scsi_perform_transaction(USBHMassStorageLUNDriver *lunp, if (scsi_requestsense(lunp, &sense) == MSD_RESULT_OK) { uwarnf("\tMSD: REQUEST SENSE: Sense key=%x, ASC=%02x, ASCQ=%02x", sense.byte[2] & 0xf, sense.byte[12], sense.byte[13]); + + return MSD_RESULT_OK; } } return MSD_RESULT_FAILED; -- cgit v1.2.3