Fixed Mass Storage Host Class driver and Low Level demo not clearing the error condit...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / MassStorage.c
index 75b8ef4..ca07175 100644 (file)
@@ -305,7 +305,7 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
 \r
 uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_t* const MaxLUNIndex)\r
 {\r
-       uint8_t ErrorCode;\r
+       uint8_t ErrorCode = HOST_SENDCONTROL_Successful;\r
 \r
        USB_ControlRequest = (USB_Request_Header_t)\r
                {\r
@@ -319,7 +319,10 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_
        Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
 \r
        if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) != HOST_SENDCONTROL_Successful)\r
-         *MaxLUNIndex = 0;\r
+       {\r
+               *MaxLUNIndex = 0;\r
+               ErrorCode = HOST_SENDCONTROL_Successful;\r
+       }\r
        \r
        return ErrorCode;\r
 }\r