usbd_gs_can: USBD_GS_CAN_GetCfgDesc(): add comment why the USBD_GS_CAN_CfgDesc is copied to RAM

This commit is contained in:
Marc Kleine-Budde 2022-12-15 09:34:57 +01:00 committed by Marc Kleine-Budde
parent fe0eef5e8f
commit 65c6eefc8b

View File

@ -646,8 +646,13 @@ static uint8_t USBD_GS_CAN_SOF(struct _USBD_HandleTypeDef *pdev)
static uint8_t *USBD_GS_CAN_GetCfgDesc(uint16_t *len)
{
/*
* The USB stack writes to the returned buffer, so it cannot live
* in ROM.
*/
*len = sizeof(USBD_GS_CAN_CfgDesc);
memcpy(USBD_DescBuf, USBD_GS_CAN_CfgDesc, sizeof(USBD_GS_CAN_CfgDesc));
return USBD_DescBuf;
}