1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

Use static definition for ClassData to support USB MSC DMA on G4

This commit is contained in:
Steve Evans 2021-08-29 22:38:48 +01:00
parent 86aa5cc84e
commit f39467c396
4 changed files with 14 additions and 34 deletions

View file

@ -283,6 +283,7 @@ __ALIGN_BEGIN uint8_t USBD_MSC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC]
* @}
*/
static DMA_DATA_ZERO_INIT USBD_MSC_BOT_HandleTypeDef ClassData;
/** @defgroup MSC_CORE_Private_Functions
* @{
@ -328,18 +329,12 @@ uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev,
USBD_EP_TYPE_BULK,
MSC_MAX_FS_PACKET);
}
pdev->pClassData = USBD_malloc(sizeof (USBD_MSC_BOT_HandleTypeDef));
if(pdev->pClassData == NULL)
{
ret = 1;
}
else
{
/* Init the BOT layer */
MSC_BOT_Init(pdev);
ret = 0;
}
pdev->pMSC_ClassData = (void *)&ClassData;
/* Init the BOT layer */
MSC_BOT_Init(pdev);
ret = 0;
return ret;
}