1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

f4 usb: allow device->host data to be const

This allows the application code to pass const
descriptors to the Tx APIs in the STM32 USB
library.
This commit is contained in:
Stacey Sheldon 2012-02-07 02:02:58 -05:00
parent 4b911bb3be
commit 58bbe0870d
6 changed files with 6 additions and 7 deletions

View File

@ -77,7 +77,7 @@
*/
USBD_Status USBD_CtlSendData (USB_OTG_CORE_HANDLE *pdev,
uint8_t *buf,
const uint8_t *buf,
uint16_t len);
USBD_Status USBD_CtlContinueSendData (USB_OTG_CORE_HANDLE *pdev,

View File

@ -86,7 +86,7 @@
* @retval status
*/
USBD_Status USBD_CtlSendData (USB_OTG_CORE_HANDLE *pdev,
uint8_t *pbuf,
const uint8_t *pbuf,
uint16_t len)
{
USBD_Status ret = USBD_OK;

View File

@ -360,7 +360,7 @@ static void USBD_GetDescriptor(USB_OTG_CORE_HANDLE *pdev,
USB_SETUP_REQ *req)
{
uint16_t len;
uint8_t *pbuf;
const uint8_t * pbuf;
switch (req->wValue >> 8)
{
@ -381,7 +381,6 @@ static void USBD_GetDescriptor(USB_OTG_CORE_HANDLE *pdev,
pbuf = (uint8_t *)pdev->dev.class_cb->GetOtherConfigDescriptor(pdev->cfg.speed, &len);
}
#endif
pbuf[1] = USB_DESC_TYPE_CONFIGURATION;
pdev->dev.pConfig_descriptor = pbuf;
break;

View File

@ -256,7 +256,7 @@ typedef struct _DCD
USBD_Class_cb_TypeDef *class_cb;
USBD_Usr_cb_TypeDef *usr_cb;
USBD_DEVICE *usr_device;
uint8_t *pConfig_descriptor;
const uint8_t *pConfig_descriptor;
}
DCD_DEV , *DCD_PDEV;

View File

@ -122,7 +122,7 @@ uint32_t DCD_EP_PrepareRx ( USB_OTG_CORE_HANDLE *pdev,
uint32_t DCD_EP_Tx (USB_OTG_CORE_HANDLE *pdev,
uint8_t ep_addr,
uint8_t *pbuf,
const uint8_t *pbuf,
uint32_t buf_len);
uint32_t DCD_EP_Stall (USB_OTG_CORE_HANDLE *pdev,
uint8_t epnum);

View File

@ -254,7 +254,7 @@ uint32_t DCD_EP_PrepareRx( USB_OTG_CORE_HANDLE *pdev,
*/
uint32_t DCD_EP_Tx ( USB_OTG_CORE_HANDLE *pdev,
uint8_t ep_addr,
uint8_t *pbuf,
const uint8_t *pbuf,
uint32_t buf_len)
{
USB_OTG_EP *ep;