forked from stm/stm32-mw-usb-device
Release v2.5.3
This commit is contained in:
@@ -27,16 +27,16 @@
|
||||
* This software component is licensed by ST under Ultimate Liberty license
|
||||
* SLA0044, the "License"; You may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at:
|
||||
* http://www.st.com/SLA0044
|
||||
* www.st.com/SLA0044
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* BSPDependencies
|
||||
- "stm32xxxxx_{eval}{discovery}{nucleo_144}.c"
|
||||
- "stm32xxxxx_{eval}{discovery}_io.c"
|
||||
- "stm32xxxxx_{eval}{discovery}{adafruit}_sd.c"
|
||||
EndBSPDependencies */
|
||||
/* BSPDependencies
|
||||
- "stm32xxxxx_{eval}{discovery}{nucleo_144}.c"
|
||||
- "stm32xxxxx_{eval}{discovery}_io.c"
|
||||
- "stm32xxxxx_{eval}{discovery}{adafruit}_sd.c"
|
||||
EndBSPDependencies */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "usbd_msc.h"
|
||||
@@ -80,30 +80,16 @@
|
||||
/** @defgroup MSC_CORE_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev,
|
||||
uint8_t cfgidx);
|
||||
|
||||
uint8_t USBD_MSC_DeInit (USBD_HandleTypeDef *pdev,
|
||||
uint8_t cfgidx);
|
||||
|
||||
uint8_t USBD_MSC_Setup (USBD_HandleTypeDef *pdev,
|
||||
USBD_SetupReqTypedef *req);
|
||||
|
||||
uint8_t USBD_MSC_DataIn (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum);
|
||||
|
||||
|
||||
uint8_t USBD_MSC_DataOut (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum);
|
||||
|
||||
uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length);
|
||||
|
||||
uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length);
|
||||
|
||||
uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length);
|
||||
|
||||
uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length);
|
||||
uint8_t USBD_MSC_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
|
||||
uint8_t USBD_MSC_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
|
||||
uint8_t USBD_MSC_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
|
||||
uint8_t USBD_MSC_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum);
|
||||
uint8_t USBD_MSC_DataOut(USBD_HandleTypeDef *pdev, uint8_t epnum);
|
||||
|
||||
uint8_t *USBD_MSC_GetHSCfgDesc(uint16_t *length);
|
||||
uint8_t *USBD_MSC_GetFSCfgDesc(uint16_t *length);
|
||||
uint8_t *USBD_MSC_GetOtherSpeedCfgDesc(uint16_t *length);
|
||||
uint8_t *USBD_MSC_GetDeviceQualifierDescriptor(uint16_t *length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -179,9 +165,8 @@ __ALIGN_BEGIN uint8_t USBD_MSC_CfgHSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
|
||||
|
||||
/* USB Mass storage device Configuration Descriptor */
|
||||
/* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
|
||||
uint8_t USBD_MSC_CfgFSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
|
||||
__ALIGN_BEGIN uint8_t USBD_MSC_CfgFSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
|
||||
{
|
||||
|
||||
0x09, /* bLength: Configuation Descriptor size */
|
||||
USB_DESC_TYPE_CONFIGURATION, /* bDescriptorType: Configuration */
|
||||
USB_MSC_CONFIG_DESC_SIZ,
|
||||
@@ -223,7 +208,6 @@ uint8_t USBD_MSC_CfgFSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
|
||||
|
||||
__ALIGN_BEGIN uint8_t USBD_MSC_OtherSpeedCfgDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
|
||||
{
|
||||
|
||||
0x09, /* bLength: Configuation Descriptor size */
|
||||
USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION,
|
||||
USB_MSC_CONFIG_DESC_SIZ,
|
||||
@@ -293,9 +277,9 @@ __ALIGN_BEGIN uint8_t USBD_MSC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC]
|
||||
* @param cfgidx: configuration index
|
||||
* @retval status
|
||||
*/
|
||||
uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
uint8_t USBD_MSC_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
{
|
||||
if(pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
if (pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
{
|
||||
/* Open EP OUT */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPOUT_ADDR, USBD_EP_TYPE_BULK, MSC_MAX_HS_PACKET);
|
||||
@@ -315,9 +299,9 @@ uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
USBD_LL_OpenEP(pdev, MSC_EPIN_ADDR, USBD_EP_TYPE_BULK, MSC_MAX_FS_PACKET);
|
||||
pdev->ep_in[MSC_EPIN_ADDR & 0xFU].is_used = 1U;
|
||||
}
|
||||
pdev->pClassData = USBD_malloc(sizeof (USBD_MSC_BOT_HandleTypeDef));
|
||||
pdev->pClassData = USBD_malloc(sizeof(USBD_MSC_BOT_HandleTypeDef));
|
||||
|
||||
if(pdev->pClassData == NULL)
|
||||
if (pdev->pClassData == NULL)
|
||||
{
|
||||
return USBD_FAIL;
|
||||
}
|
||||
@@ -335,8 +319,8 @@ uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
* @param cfgidx: configuration index
|
||||
* @retval status
|
||||
*/
|
||||
uint8_t USBD_MSC_DeInit (USBD_HandleTypeDef *pdev,
|
||||
uint8_t cfgidx)
|
||||
uint8_t USBD_MSC_DeInit(USBD_HandleTypeDef *pdev,
|
||||
uint8_t cfgidx)
|
||||
{
|
||||
/* Close MSC EPs */
|
||||
USBD_LL_CloseEP(pdev, MSC_EPOUT_ADDR);
|
||||
@@ -346,15 +330,16 @@ uint8_t USBD_MSC_DeInit (USBD_HandleTypeDef *pdev,
|
||||
USBD_LL_CloseEP(pdev, MSC_EPIN_ADDR);
|
||||
pdev->ep_in[MSC_EPIN_ADDR & 0xFU].is_used = 0U;
|
||||
|
||||
/* De-Init the BOT layer */
|
||||
/* De-Init the BOT layer */
|
||||
MSC_BOT_DeInit(pdev);
|
||||
|
||||
/* Free MSC Class Resources */
|
||||
if(pdev->pClassData != NULL)
|
||||
if (pdev->pClassData != NULL)
|
||||
{
|
||||
USBD_free(pdev->pClassData);
|
||||
pdev->pClassData = NULL;
|
||||
}
|
||||
|
||||
return USBD_OK;
|
||||
}
|
||||
/**
|
||||
@@ -364,149 +349,148 @@ uint8_t USBD_MSC_DeInit (USBD_HandleTypeDef *pdev,
|
||||
* @param req: USB request
|
||||
* @retval status
|
||||
*/
|
||||
uint8_t USBD_MSC_Setup (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
|
||||
uint8_t USBD_MSC_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
|
||||
{
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*) pdev->pClassData;
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef *) pdev->pClassData;
|
||||
uint8_t ret = USBD_OK;
|
||||
uint16_t status_info = 0U;
|
||||
|
||||
switch (req->bmRequest & USB_REQ_TYPE_MASK)
|
||||
{
|
||||
|
||||
/* Class request */
|
||||
case USB_REQ_TYPE_CLASS:
|
||||
switch (req->bRequest)
|
||||
{
|
||||
case BOT_GET_MAX_LUN:
|
||||
if((req->wValue == 0U) && (req->wLength == 1U) &&
|
||||
((req->bmRequest & 0x80U) == 0x80U))
|
||||
case USB_REQ_TYPE_CLASS:
|
||||
switch (req->bRequest)
|
||||
{
|
||||
hmsc->max_lun = (uint32_t)((USBD_StorageTypeDef *)pdev->pUserData)->GetMaxLun();
|
||||
USBD_CtlSendData (pdev, (uint8_t *)(void *)&hmsc->max_lun, 1U);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
case BOT_GET_MAX_LUN:
|
||||
if ((req->wValue == 0U) && (req->wLength == 1U) &&
|
||||
((req->bmRequest & 0x80U) == 0x80U))
|
||||
{
|
||||
hmsc->max_lun = (uint32_t)((USBD_StorageTypeDef *)pdev->pUserData)->GetMaxLun();
|
||||
USBD_CtlSendData(pdev, (uint8_t *)(void *)&hmsc->max_lun, 1U);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
|
||||
case BOT_RESET :
|
||||
if((req->wValue == 0U) && (req->wLength == 0U) &&
|
||||
((req->bmRequest & 0x80U) != 0x80U))
|
||||
{
|
||||
MSC_BOT_Reset(pdev);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev , req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
case BOT_RESET :
|
||||
if ((req->wValue == 0U) && (req->wLength == 0U) &&
|
||||
((req->bmRequest & 0x80U) != 0x80U))
|
||||
{
|
||||
MSC_BOT_Reset(pdev);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
USBD_CtlError(pdev , req);
|
||||
ret = USBD_FAIL;
|
||||
default:
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
/* Interface & Endpoint request */
|
||||
case USB_REQ_TYPE_STANDARD:
|
||||
switch (req->bRequest)
|
||||
{
|
||||
case USB_REQ_GET_STATUS:
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED)
|
||||
case USB_REQ_TYPE_STANDARD:
|
||||
switch (req->bRequest)
|
||||
{
|
||||
USBD_CtlSendData (pdev, (uint8_t *)(void *)&status_info, 2U);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError (pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
case USB_REQ_GET_STATUS:
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED)
|
||||
{
|
||||
USBD_CtlSendData(pdev, (uint8_t *)(void *)&status_info, 2U);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
|
||||
case USB_REQ_GET_INTERFACE:
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED)
|
||||
{
|
||||
USBD_CtlSendData (pdev, (uint8_t *)(void *)&hmsc->interface, 1U);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError (pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
case USB_REQ_GET_INTERFACE:
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED)
|
||||
{
|
||||
USBD_CtlSendData(pdev, (uint8_t *)(void *)&hmsc->interface, 1U);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
|
||||
case USB_REQ_SET_INTERFACE:
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED)
|
||||
{
|
||||
hmsc->interface = (uint8_t)(req->wValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError (pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
case USB_REQ_SET_INTERFACE:
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED)
|
||||
{
|
||||
hmsc->interface = (uint8_t)(req->wValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
}
|
||||
break;
|
||||
|
||||
case USB_REQ_CLEAR_FEATURE:
|
||||
case USB_REQ_CLEAR_FEATURE:
|
||||
|
||||
/* Flush the FIFO and Clear the stall status */
|
||||
USBD_LL_FlushEP(pdev, (uint8_t)req->wIndex);
|
||||
/* Flush the FIFO and Clear the stall status */
|
||||
USBD_LL_FlushEP(pdev, (uint8_t)req->wIndex);
|
||||
|
||||
/* Reactivate the EP */
|
||||
USBD_LL_CloseEP (pdev , (uint8_t)req->wIndex);
|
||||
if((((uint8_t)req->wIndex) & 0x80U) == 0x80U)
|
||||
{
|
||||
pdev->ep_in[(uint8_t)req->wIndex & 0xFU].is_used = 0U;
|
||||
if(pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
{
|
||||
/* Open EP IN */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPIN_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_HS_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open EP IN */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPIN_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_FS_PACKET);
|
||||
}
|
||||
pdev->ep_in[MSC_EPIN_ADDR & 0xFU].is_used = 1U;
|
||||
/* Reactivate the EP */
|
||||
USBD_LL_CloseEP(pdev, (uint8_t)req->wIndex);
|
||||
if ((((uint8_t)req->wIndex) & 0x80U) == 0x80U)
|
||||
{
|
||||
pdev->ep_in[(uint8_t)req->wIndex & 0xFU].is_used = 0U;
|
||||
if (pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
{
|
||||
/* Open EP IN */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPIN_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_HS_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open EP IN */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPIN_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_FS_PACKET);
|
||||
}
|
||||
pdev->ep_in[MSC_EPIN_ADDR & 0xFU].is_used = 1U;
|
||||
}
|
||||
else
|
||||
{
|
||||
pdev->ep_out[(uint8_t)req->wIndex & 0xFU].is_used = 0U;
|
||||
if (pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
{
|
||||
/* Open EP OUT */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPOUT_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_HS_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open EP OUT */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPOUT_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_FS_PACKET);
|
||||
}
|
||||
pdev->ep_out[MSC_EPOUT_ADDR & 0xFU].is_used = 1U;
|
||||
}
|
||||
|
||||
/* Handle BOT error */
|
||||
MSC_BOT_CplClrFeature(pdev, (uint8_t)req->wIndex);
|
||||
break;
|
||||
|
||||
default:
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
pdev->ep_out[(uint8_t)req->wIndex & 0xFU].is_used = 0U;
|
||||
if(pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
{
|
||||
/* Open EP OUT */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPOUT_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_HS_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open EP OUT */
|
||||
USBD_LL_OpenEP(pdev, MSC_EPOUT_ADDR, USBD_EP_TYPE_BULK,
|
||||
MSC_MAX_FS_PACKET);
|
||||
}
|
||||
pdev->ep_out[MSC_EPOUT_ADDR & 0xFU].is_used = 1U;
|
||||
}
|
||||
|
||||
/* Handle BOT error */
|
||||
MSC_BOT_CplClrFeature(pdev, (uint8_t)req->wIndex);
|
||||
break;
|
||||
|
||||
default:
|
||||
USBD_CtlError (pdev, req);
|
||||
USBD_CtlError(pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
USBD_CtlError (pdev, req);
|
||||
ret = USBD_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -519,10 +503,10 @@ uint8_t USBD_MSC_Setup (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
|
||||
* @param epnum: endpoint index
|
||||
* @retval status
|
||||
*/
|
||||
uint8_t USBD_MSC_DataIn (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum)
|
||||
uint8_t USBD_MSC_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
|
||||
{
|
||||
MSC_BOT_DataIn(pdev , epnum);
|
||||
MSC_BOT_DataIn(pdev, epnum);
|
||||
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
@@ -533,10 +517,10 @@ uint8_t USBD_MSC_DataIn (USBD_HandleTypeDef *pdev,
|
||||
* @param epnum: endpoint index
|
||||
* @retval status
|
||||
*/
|
||||
uint8_t USBD_MSC_DataOut (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum)
|
||||
uint8_t USBD_MSC_DataOut(USBD_HandleTypeDef *pdev, uint8_t epnum)
|
||||
{
|
||||
MSC_BOT_DataOut(pdev , epnum);
|
||||
MSC_BOT_DataOut(pdev, epnum);
|
||||
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
@@ -546,9 +530,10 @@ uint8_t USBD_MSC_DataOut (USBD_HandleTypeDef *pdev,
|
||||
* @param length : pointer data length
|
||||
* @retval pointer to descriptor buffer
|
||||
*/
|
||||
uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length)
|
||||
uint8_t *USBD_MSC_GetHSCfgDesc(uint16_t *length)
|
||||
{
|
||||
*length = sizeof (USBD_MSC_CfgHSDesc);
|
||||
*length = sizeof(USBD_MSC_CfgHSDesc);
|
||||
|
||||
return USBD_MSC_CfgHSDesc;
|
||||
}
|
||||
|
||||
@@ -558,9 +543,10 @@ uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length)
|
||||
* @param length : pointer data length
|
||||
* @retval pointer to descriptor buffer
|
||||
*/
|
||||
uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length)
|
||||
uint8_t *USBD_MSC_GetFSCfgDesc(uint16_t *length)
|
||||
{
|
||||
*length = sizeof (USBD_MSC_CfgFSDesc);
|
||||
*length = sizeof(USBD_MSC_CfgFSDesc);
|
||||
|
||||
return USBD_MSC_CfgFSDesc;
|
||||
}
|
||||
|
||||
@@ -570,9 +556,10 @@ uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length)
|
||||
* @param length : pointer data length
|
||||
* @retval pointer to descriptor buffer
|
||||
*/
|
||||
uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length)
|
||||
uint8_t *USBD_MSC_GetOtherSpeedCfgDesc(uint16_t *length)
|
||||
{
|
||||
*length = sizeof (USBD_MSC_OtherSpeedCfgDesc);
|
||||
*length = sizeof(USBD_MSC_OtherSpeedCfgDesc);
|
||||
|
||||
return USBD_MSC_OtherSpeedCfgDesc;
|
||||
}
|
||||
/**
|
||||
@@ -581,9 +568,10 @@ uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length)
|
||||
* @param length : pointer data length
|
||||
* @retval pointer to descriptor buffer
|
||||
*/
|
||||
uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length)
|
||||
uint8_t *USBD_MSC_GetDeviceQualifierDescriptor(uint16_t *length)
|
||||
{
|
||||
*length = sizeof (USBD_MSC_DeviceQualifierDesc);
|
||||
*length = sizeof(USBD_MSC_DeviceQualifierDesc);
|
||||
|
||||
return USBD_MSC_DeviceQualifierDesc;
|
||||
}
|
||||
|
||||
@@ -592,13 +580,14 @@ uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length)
|
||||
* @param fops: storage callback
|
||||
* @retval status
|
||||
*/
|
||||
uint8_t USBD_MSC_RegisterStorage (USBD_HandleTypeDef *pdev,
|
||||
USBD_StorageTypeDef *fops)
|
||||
uint8_t USBD_MSC_RegisterStorage(USBD_HandleTypeDef *pdev,
|
||||
USBD_StorageTypeDef *fops)
|
||||
{
|
||||
if(fops != NULL)
|
||||
if (fops != NULL)
|
||||
{
|
||||
pdev->pUserData = fops;
|
||||
}
|
||||
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user