mirror of
https://github.com/candle-usb/candleLight_fw.git
synced 2025-02-04 06:12:55 +08:00
The USBD_GS_CAN_SendToHost() function is used to send to struct gs_host_frame_object to the host. Until this patch, after the sending process has been started, the outgoing frame object is already added to the list of free objects and the variable USBD_GS_CAN_HandleTypeDef::TxState is used to track if the transfer to the host is in progress. Instead, hold the outgoing object in USBD_GS_CAN_HandleTypeDef::to_host_buf and move it to the free list after the transfer is finished in USBD_GS_CAN_DataIn(). Use this to track if a transfer is ongoing.