aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/MassStorage.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-12-04 09:08:48 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-12-04 09:08:48 +0000
commitc49bdcb7c930f2d0e0cf6887b3326f9e8f7f37b3 (patch)
tree43858ac2a66d50dd0385f1c4de1eea4d685976b5 /LUFA/Drivers/USB/Class/Host/MassStorage.c
parent478d9dc04f477c63db990a52a3866f29093b38dc (diff)
downloadlufa-c49bdcb7c930f2d0e0cf6887b3326f9e8f7f37b3.tar.gz
lufa-c49bdcb7c930f2d0e0cf6887b3326f9e8f7f37b3.tar.bz2
lufa-c49bdcb7c930f2d0e0cf6887b3326f9e8f7f37b3.zip
Fixed Mass Storage Host Class driver and Low Level demo not clearing the error condition if an attached device returns a STALL to a GET MAX LUN request (thanks to Martin Luxen).
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/MassStorage.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c
index 75b8ef485..ca071752d 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c
@@ -305,7 +305,7 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_t* const MaxLUNIndex)
{
- uint8_t ErrorCode;
+ uint8_t ErrorCode = HOST_SENDCONTROL_Successful;
USB_ControlRequest = (USB_Request_Header_t)
{
@@ -319,7 +319,10 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_
Pipe_SelectPipe(PIPE_CONTROLPIPE);
if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) != HOST_SENDCONTROL_Successful)
- *MaxLUNIndex = 0;
+ {
+ *MaxLUNIndex = 0;
+ ErrorCode = HOST_SENDCONTROL_Successful;
+ }
return ErrorCode;
}