summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stmhal/usbd_hid_interface.c3
-rw-r--r--stmhal/usbdev/class/src/usbd_cdc_msc_hid.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/stmhal/usbd_hid_interface.c b/stmhal/usbd_hid_interface.c
index 10e03fa42..04f1b7fd0 100644
--- a/stmhal/usbd_hid_interface.c
+++ b/stmhal/usbd_hid_interface.c
@@ -47,12 +47,11 @@
static __IO uint8_t dev_is_connected = 0; // indicates if we are connected
-static uint8_t buffer[2][64]; // pair of buffers to read individual packets into
+static uint8_t buffer[2][HID_DATA_FS_MAX_PACKET_SIZE]; // pair of buffers to read individual packets into
static int8_t current_read_buffer = 0; // which buffer to read from
static uint32_t last_read_len; // length of last read
static int8_t current_write_buffer = 0; // which buffer to write to
-static size_t rx_packet_size = 64; // expected size of packets to receive
/* Private function prototypes -----------------------------------------------*/
static int8_t HID_Itf_Receive (uint8_t* pbuf, uint32_t Len);
diff --git a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
index 3ac902932..913b2ecc1 100644
--- a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
+++ b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
@@ -53,6 +53,7 @@
#define HID_IN_EP_WITH_CDC (0x81)
#define HID_OUT_EP_WITH_CDC (0x01)
#define HID_IN_EP_WITH_MSC (0x83)
+#define HID_OUT_EP_WITH_MSC (0x03)
#define USB_DESC_TYPE_ASSOCIATION (0x0b)
@@ -613,6 +614,7 @@ int USBD_SelectMode(uint32_t mode, USBD_HID_ModeInfoTypeDef *hid_info) {
// not implemented
case USBD_MODE_MSC_HID:
hid_in_ep = HID_IN_EP_WITH_MSC;
+ hid_out_ep = HID_OUT_EP_WITH_MSC;
hid_iface_num = HID_IFACE_NUM_WITH_MSC;
break;
*/
@@ -723,7 +725,7 @@ static uint8_t USBD_CDC_MSC_HID_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx) {
mps_out);
// Prepare Out endpoint to receive next packet
- USBD_LL_PrepareReceive(pdev, hid_out_ep, CDC_ClassData.RxBuffer, mps_out);
+ USBD_LL_PrepareReceive(pdev, hid_out_ep, HID_ClassData.RxBuffer, mps_out);
HID_ClassData.state = HID_IDLE;
}