stm32/usbdev: Make the USBD callback struct const so it can go in ROM.
This commit is contained in:
parent
fc9a6dd09e
commit
78602a217f
|
@ -96,7 +96,7 @@ extern const uint8_t USBD_HID_MOUSE_ReportDesc[USBD_HID_MOUSE_REPORT_DESC_SIZE];
|
||||||
|
|
||||||
extern const uint8_t USBD_HID_KEYBOARD_ReportDesc[USBD_HID_KEYBOARD_REPORT_DESC_SIZE];
|
extern const uint8_t USBD_HID_KEYBOARD_ReportDesc[USBD_HID_KEYBOARD_REPORT_DESC_SIZE];
|
||||||
|
|
||||||
extern USBD_ClassTypeDef USBD_CDC_MSC_HID;
|
extern const USBD_ClassTypeDef USBD_CDC_MSC_HID;
|
||||||
|
|
||||||
// returns 0 on success, -1 on failure
|
// returns 0 on success, -1 on failure
|
||||||
int USBD_SelectMode(uint32_t mode, USBD_HID_ModeInfoTypeDef *hid_info);
|
int USBD_SelectMode(uint32_t mode, USBD_HID_ModeInfoTypeDef *hid_info);
|
||||||
|
|
|
@ -1112,7 +1112,7 @@ uint8_t USBD_HID_ClearNAK(USBD_HandleTypeDef *pdev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CDC/MSC/HID interface class callback structure
|
// CDC/MSC/HID interface class callback structure
|
||||||
USBD_ClassTypeDef USBD_CDC_MSC_HID = {
|
const USBD_ClassTypeDef USBD_CDC_MSC_HID = {
|
||||||
USBD_CDC_MSC_HID_Init,
|
USBD_CDC_MSC_HID_Init,
|
||||||
USBD_CDC_MSC_HID_DeInit,
|
USBD_CDC_MSC_HID_DeInit,
|
||||||
USBD_CDC_MSC_HID_Setup,
|
USBD_CDC_MSC_HID_Setup,
|
||||||
|
|
|
@ -88,7 +88,7 @@ USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, USBD_DescriptorsTypeDef *
|
||||||
USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev);
|
USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev);
|
||||||
USBD_StatusTypeDef USBD_Start (USBD_HandleTypeDef *pdev);
|
USBD_StatusTypeDef USBD_Start (USBD_HandleTypeDef *pdev);
|
||||||
USBD_StatusTypeDef USBD_Stop (USBD_HandleTypeDef *pdev);
|
USBD_StatusTypeDef USBD_Stop (USBD_HandleTypeDef *pdev);
|
||||||
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass);
|
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, const USBD_ClassTypeDef *pclass);
|
||||||
|
|
||||||
USBD_StatusTypeDef USBD_RunTestMode (USBD_HandleTypeDef *pdev);
|
USBD_StatusTypeDef USBD_RunTestMode (USBD_HandleTypeDef *pdev);
|
||||||
USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
|
USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
|
||||||
|
|
|
@ -235,7 +235,7 @@ typedef struct _USBD_HandleTypeDef
|
||||||
|
|
||||||
USBD_SetupReqTypedef request;
|
USBD_SetupReqTypedef request;
|
||||||
USBD_DescriptorsTypeDef *pDesc;
|
USBD_DescriptorsTypeDef *pDesc;
|
||||||
USBD_ClassTypeDef *pClass;
|
const USBD_ClassTypeDef *pClass;
|
||||||
void *pClassData;
|
void *pClassData;
|
||||||
void *pUserData;
|
void *pUserData;
|
||||||
void *pData;
|
void *pData;
|
||||||
|
|
|
@ -155,7 +155,7 @@ USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev)
|
||||||
* @param pclass: Class handle
|
* @param pclass: Class handle
|
||||||
* @retval USBD Status
|
* @retval USBD Status
|
||||||
*/
|
*/
|
||||||
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass)
|
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, const USBD_ClassTypeDef *pclass)
|
||||||
{
|
{
|
||||||
USBD_StatusTypeDef status = USBD_OK;
|
USBD_StatusTypeDef status = USBD_OK;
|
||||||
if(pclass != 0)
|
if(pclass != 0)
|
||||||
|
|
Loading…
Reference in New Issue