As part of xmos/sln_avona#21 - thought I'd spin it off into a separate PR!
This PR does two things:
Adds a new instruction to dcd_xcore_int_handler capturing the packet timestamp at time of call in terms of the reference clock and storing in a new variable uint32_t cur_time.
Adds a new callback to dcd_xcore_int_handler in the USB data packet handling logic with the following signature:
cur_time is the timestamp of the packet transmitted, in terms of the reference clock.
ep_num is the number of the endpoint over which the packet has been transmitted.
ep_dir is the direction of the endpoint over which the packet has been transmitted.
xfer_len is the length of the data packet transmitted.
The function currently expects a bool return, but does nothing with this return value. This opens the possibility of application callbacks being able to modify behaviour of the DCD dynamically. It is suggested for forwards-compatibility that applications that implement this callback set the return to True in line with the expectations of tud_xcore_sof_cb, where a return value of True instructs TinyUSB to send the SOF event to the stack.
As part of xmos/sln_avona#21 - thought I'd spin it off into a separate PR!
This PR does two things:
dcd_xcore_int_handler
capturing the packet timestamp at time of call in terms of the reference clock and storing in a new variableuint32_t cur_time
.dcd_xcore_int_handler
in the USB data packet handling logic with the following signature:where
cur_time
is the timestamp of the packet transmitted, in terms of the reference clock.ep_num
is the number of the endpoint over which the packet has been transmitted.ep_dir
is the direction of the endpoint over which the packet has been transmitted.xfer_len
is the length of the data packet transmitted.The function currently expects a
bool
return, but does nothing with this return value. This opens the possibility of application callbacks being able to modify behaviour of the DCD dynamically. It is suggested for forwards-compatibility that applications that implement this callback set the return toTrue
in line with the expectations oftud_xcore_sof_cb
, where a return value ofTrue
instructs TinyUSB to send the SOF event to the stack.