Skip to content

Commit

Permalink
Merge pull request #3 from NickGuyver/main
Browse files Browse the repository at this point in the history
  • Loading branch information
maximevince authored Dec 15, 2023
2 parents 3e41cd0 + 0e60865 commit 955621b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/usb/usbh_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ static inline void trigger_thread_by_os_message(USBH_HandleTypeDef *phost)
*/
/* static */ USBH_StatusTypeDef USBH_HID_Process(USBH_HandleTypeDef *phost)
{
// collect the timestamp as early as possible
uint32_t timestamp = xlat_counter_1mhz_get();
USBH_StatusTypeDef status = USBH_OK;
HID_HandleTypeDef *HID_Handle = (HID_HandleTypeDef *) phost->pActiveClass->pData;
uint32_t XferSize;
Expand Down Expand Up @@ -384,7 +386,6 @@ static inline void trigger_thread_by_os_message(USBH_HandleTypeDef *phost)

//if ((HID_Handle->DataReady == 0U) && (XferSize != 0U)) {
if (XferSize != 0U) {
uint32_t timestamp = xlat_counter_1mhz_get();
(void)USBH_HID_FifoWrite(&HID_Handle->fifo, HID_Handle->pData, HID_Handle->length);
USBH_HID_EventCallback(phost, timestamp); // triggers the main thread with the timestamp of this event
HID_Handle->state = USBH_HID_GET_DATA;
Expand Down

0 comments on commit 955621b

Please sign in to comment.