Firmware: Get data and size on usbd_custom_hid_if.c
This commit is contained in:
@@ -198,7 +198,13 @@ static int8_t CUSTOM_HID_OutEvent_FS(uint8_t event_idx, uint8_t state)
|
|||||||
/* USER CODE BEGIN 6 */
|
/* USER CODE BEGIN 6 */
|
||||||
UNUSED(event_idx);
|
UNUSED(event_idx);
|
||||||
UNUSED(state);
|
UNUSED(state);
|
||||||
|
USBD_CUSTOM_HID_HandleTypeDef* hhid = (USBD_CUSTOM_HID_HandleTypeDef*)hUsbDeviceFS.pClassData;
|
||||||
|
PCD_HandleTypeDef* hpcd = (PCD_HandleTypeDef*)hUsbDeviceFS.pData;
|
||||||
|
|
||||||
|
// Get received data (64 bytes)
|
||||||
|
uint8_t *data = hhid->Report_buf;
|
||||||
|
uint8_t report_id = data[0];
|
||||||
|
uint32_t size = HAL_PCD_EP_GetRxCount(hpcd, CUSTOM_HID_EPOUT_ADDR);
|
||||||
/* Start next USB packet transfer once data processing is completed */
|
/* Start next USB packet transfer once data processing is completed */
|
||||||
USBD_CUSTOM_HID_ReceivePacket(&hUsbDeviceFS);
|
USBD_CUSTOM_HID_ReceivePacket(&hUsbDeviceFS);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user