From 98fdcfc55543025816b68a2337c4e2b935feb275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 14 Apr 2017 00:10:30 +0200 Subject: [PATCH] Remove the unused usb_device_set_speed() --- right/src/buspal/bm_usb/usb_descriptor.c | 42 ++++++++---------------- right/src/buspal/bm_usb/usb_descriptor.h | 14 -------- 2 files changed, 13 insertions(+), 43 deletions(-) diff --git a/right/src/buspal/bm_usb/usb_descriptor.c b/right/src/buspal/bm_usb/usb_descriptor.c index 41969b3..219e010 100644 --- a/right/src/buspal/bm_usb/usb_descriptor.c +++ b/right/src/buspal/bm_usb/usb_descriptor.c @@ -1,13 +1,20 @@ #include "usb_device_config.h" -#include "usb.h" -#include "usb_device.h" - -#include "usb_device_class.h" -#include "usb_device_hid.h" #include "bootloader_hid_report_ids.h" - #include "usb_descriptor.h" +usb_status_t usb_device_get_device_descriptor( + usb_device_handle handle, usb_device_get_device_descriptor_struct_t *device_descriptor); +usb_status_t usb_device_get_configuration_descriptor( + usb_device_handle handle, usb_device_get_configuration_descriptor_struct_t *configuration_descriptor); +usb_status_t usb_device_get_string_descriptor( + usb_device_handle handle, usb_device_get_string_descriptor_struct_t *string_descriptor); +usb_status_t usb_device_get_hid_descriptor( + usb_device_handle handle, usb_device_get_hid_descriptor_struct_t *hid_descriptor); +usb_status_t usb_device_get_hid_report_descriptor( + usb_device_handle handle, usb_device_get_hid_report_descriptor_struct_t *hid_report_descriptor); +usb_status_t usb_device_get_hid_physical_descriptor( + usb_device_handle handle, usb_device_get_hid_physical_descriptor_struct_t *hid_physical_descriptor); + #define BL_MIN_PACKET_SIZE (32) #define BL_PACKET_SIZE_HEADER_SIZE (3) // alignment byte + length lsb + length msb (does not include report id) #define BL_REPORT_SIZE (BL_MIN_PACKET_SIZE + BL_PACKET_SIZE_HEADER_SIZE) @@ -352,26 +359,3 @@ usb_status_t usb_device_get_string_descriptor( } return kStatus_USB_Success; } - -usb_status_t usb_device_set_speed(usb_device_handle handle, uint8_t speed) -{ - usb_hid_config_descriptor_t *ptr_hid = NULL; - ptr_hid = (usb_hid_config_descriptor_t *)&g_config_descriptor[USB_HID_CONFIG_INDEX]; - - // HID interface - USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE, ptr_hid->endpoint_in.wMaxPacketSize); - ptr_hid->endpoint_in.bInterval = FS_HID_GENERIC_INTERRUPT_IN_INTERVAL; - - USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE, ptr_hid->endpoint_out.wMaxPacketSize); - ptr_hid->endpoint_out.bInterval = FS_HID_GENERIC_INTERRUPT_OUT_INTERVAL; - - for (uint32_t i = 0; i < USB_HID_GENERIC_ENDPOINT_COUNT; i++) { - if (g_hid_generic_endpoints[i].endpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_IN) { - g_hid_generic_endpoints[i].maxPacketSize = FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE; - } else { - g_hid_generic_endpoints[i].maxPacketSize = FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE; - } - } - - return kStatus_USB_Success; -} diff --git a/right/src/buspal/bm_usb/usb_descriptor.h b/right/src/buspal/bm_usb/usb_descriptor.h index 780a95f..71743de 100644 --- a/right/src/buspal/bm_usb/usb_descriptor.h +++ b/right/src/buspal/bm_usb/usb_descriptor.h @@ -74,20 +74,6 @@ typedef struct _usb_hid_config_descriptor { } usb_hid_config_descriptor_t; extern usb_device_class_struct_t g_hid_generic_class; -extern usb_status_t usb_device_set_speed(usb_device_handle handle, uint8_t speed); - -usb_status_t usb_device_get_device_descriptor( - usb_device_handle handle, usb_device_get_device_descriptor_struct_t *device_descriptor); -usb_status_t usb_device_get_configuration_descriptor( - usb_device_handle handle, usb_device_get_configuration_descriptor_struct_t *configuration_descriptor); -usb_status_t usb_device_get_string_descriptor( - usb_device_handle handle, usb_device_get_string_descriptor_struct_t *string_descriptor); -usb_status_t usb_device_get_hid_descriptor( - usb_device_handle handle, usb_device_get_hid_descriptor_struct_t *hid_descriptor); -usb_status_t usb_device_get_hid_report_descriptor( - usb_device_handle handle, usb_device_get_hid_report_descriptor_struct_t *hid_report_descriptor); -usb_status_t usb_device_get_hid_physical_descriptor( - usb_device_handle handle, usb_device_get_hid_physical_descriptor_struct_t *hid_physical_descriptor); extern uint8_t g_device_descriptor[]; extern usb_language_list_t g_language_list;