diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h index 6e33565..ae31481 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h @@ -263,8 +263,8 @@ HID_HandleTypeDef; /* Interface Descriptor field values for HID Boot Protocol */ #define HID_BOOT_CODE 0x01 -#define HID_KEYBRD_BOOT_CODE 0x01 -#define HID_MOUSE_BOOT_CODE 0x02 +#define HID_KEYBRD_PROTOCOL 0x01 +#define HID_MOUSE_PROTOCOL 0x02 /** diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c index 10bf289..76b4791 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c @@ -147,12 +147,12 @@ static USBH_StatusTypeDef USBH_HID_InterfaceInit (USBH_HandleTypeDef *phost) #ifdef CONFIG_MOUSE_ENABLED - interface = USBH_FindInterface(phost, phost->pActiveClass->ClassCode, HID_BOOT_CODE, HID_MOUSE_BOOT_CODE); //Search for mouse interfaces first + interface = USBH_FindInterface(phost, phost->pActiveClass->ClassCode, HID_BOOT_CODE, HID_MOUSE_PROTOCOL); //Search for mouse interfaces first #endif #ifdef CONFIG_KEYBOARD_ENABLED if (interface == 0xFF) { - interface = USBH_FindInterface(phost, phost->pActiveClass->ClassCode, HID_BOOT_CODE, HID_KEYBRD_BOOT_CODE); + interface = USBH_FindInterface(phost, phost->pActiveClass->ClassCode, HID_BOOT_CODE, HID_KEYBRD_PROTOCOL); } #endif @@ -315,7 +315,7 @@ static USBH_StatusTypeDef USBH_HID_ClassRequest(USBH_HandleTypeDef *phost) //Mouse in 'report' mode, //Keyboard in 'boot' mode if (USBH_HID_SetProtocol(phost, - (HID_Handle->Protocol == HID_MOUSE_BOOT_CODE ? 1 : 0)) == USBH_OK) + (HID_Handle->Protocol == HID_MOUSE_PROTOCOL ? 1 : 0)) == USBH_OK) { HID_Handle->ctl_state = HID_REQ_IDLE; @@ -681,12 +681,12 @@ HID_TypeTypeDef USBH_HID_GetDeviceType(USBH_HandleTypeDef *phost) { if(phost->device.CfgDesc.Itf_Desc[phost->device.current_interface].bInterfaceProtocol \ - == HID_KEYBRD_BOOT_CODE) + == HID_KEYBRD_PROTOCOL) { type = HID_KEYBOARD; } else if(phost->device.CfgDesc.Itf_Desc[phost->device.current_interface].bInterfaceProtocol \ - == HID_MOUSE_BOOT_CODE) + == HID_MOUSE_PROTOCOL) { type= HID_MOUSE; } diff --git a/Downstream/Src/downstream_hid.c b/Downstream/Src/downstream_hid.c index 1dc717a..a366f6f 100644 --- a/Downstream/Src/downstream_hid.c +++ b/Downstream/Src/downstream_hid.c @@ -55,7 +55,7 @@ InterfaceCommandClassTypeDef Downstream_HID_ApproveConnectedDevice(void) HID_HandleTypeDef* HID_Handle = (HID_HandleTypeDef*)hUsbHostFS.pActiveClass->pData; #ifdef CONFIG_MOUSE_ENABLED - if (HID_Handle->Protocol == HID_MOUSE_BOOT_CODE) + if (HID_Handle->Protocol == HID_MOUSE_PROTOCOL) { if (Downstream_HID_Mouse_ParseReportDescriptor() == HAL_OK) { @@ -64,7 +64,7 @@ InterfaceCommandClassTypeDef Downstream_HID_ApproveConnectedDevice(void) } #endif #ifdef CONFIG_KEYBOARD_ENABLED - if (HID_Handle->Protocol == HID_KEYBRD_BOOT_CODE) + if (HID_Handle->Protocol == HID_KEYBRD_PROTOCOL) { return COMMAND_CLASS_HID_KEYBOARD; //success! } diff --git a/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h b/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h index d2a0045..ad39097 100644 --- a/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h +++ b/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h @@ -74,8 +74,8 @@ #define HID_REQ_SET_REPORT 0x09 #define HID_REQ_GET_REPORT 0x01 -#define HID_KEYBRD_BOOT_CODE 0x01 -#define HID_MOUSE_BOOT_CODE 0x02 +#define HID_KEYBRD_PROTOCOL 0x01 +#define HID_MOUSE_PROTOCOL 0x02 /** * @} diff --git a/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index b8cb27c..5d46fc2 100644 --- a/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/Upstream/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c @@ -310,7 +310,7 @@ void USBD_HID_PreinitMouse(void) OutReportSize = HID_MOUSE_OUTPUT_DATA_LEN; USBD_HID.USBDevPid = USBD_PID_MOUSE; - USBD_HID_CfgDesc[USB_HID_CFGDESC__INTERFACE_PROTOCOL_OFFSET] = HID_MOUSE_BOOT_CODE; + USBD_HID_CfgDesc[USB_HID_CFGDESC__INTERFACE_PROTOCOL_OFFSET] = HID_MOUSE_PROTOCOL; USBD_HID_CfgDesc[USB_HID_CFGDESC__HID_REPORT_DESC_SIZE_OFFSET] = HID_MOUSE_REPORT_DESC_SIZE; USBD_HID_CfgDesc[USB_HID_CFGDESC__EPIN_SIZE_OFFSET] = HID_MOUSE_INPUT_DATA_LEN; USBD_HID_Desc[USB_HID_DESC__HID_REPORT_DESC_SIZE_OFFSET] = HID_MOUSE_REPORT_DESC_SIZE; @@ -327,7 +327,7 @@ void USBD_HID_PreinitKeyboard(void) OutReportSize = HID_KEYBOARD_OUTPUT_DATA_LEN; USBD_HID.USBDevPid = USBD_PID_KEYBOARD; - USBD_HID_CfgDesc[USB_HID_CFGDESC__INTERFACE_PROTOCOL_OFFSET] = HID_KEYBRD_BOOT_CODE; + USBD_HID_CfgDesc[USB_HID_CFGDESC__INTERFACE_PROTOCOL_OFFSET] = HID_KEYBRD_PROTOCOL; USBD_HID_CfgDesc[USB_HID_CFGDESC__HID_REPORT_DESC_SIZE_OFFSET] = HID_KEYBOARD_REPORT_DESC_SIZE; USBD_HID_CfgDesc[USB_HID_CFGDESC__EPIN_SIZE_OFFSET] = HID_KEYBOARD_INPUT_DATA_LEN; USBD_HID_Desc[USB_HID_DESC__HID_REPORT_DESC_SIZE_OFFSET] = HID_KEYBOARD_REPORT_DESC_SIZE;