-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
Isochronous data with asynchronous USB transfer type
Line 290 states: todo lie thru our teeth for now
in the _as_sync_packet' function
. What exactly is meant by this? What does this function do?
Does this mean the asynchronous USB transfer type is not actually providing correct feedback to the USB Host and just spoofing the feedback loop to the host? The function can be seen below. When debugging I noticed that this function is called many times which is what could be expected for something that is used as feedback loop to a USB host device. I just do not comprehend where or when this feedback is returned to the USB host device.
static void _as_sync_packet(struct usb_endpoint *ep) {
assert(ep->current_transfer);
DEBUG_PINS_SET(audio_timing, 2);
DEBUG_PINS_CLR(audio_timing, 2);
struct usb_buffer *buffer = usb_current_in_packet_buffer(ep);
assert(buffer->data_max >= 3);
buffer->data_len = 3;
// todo lie thru our teeth for now
uint feedback = (audio_state.freq << 14u) / 1000u;
buffer->data[0] = feedback;
buffer->data[1] = feedback >> 8u;
buffer->data[2] = feedback >> 16u;
printf("_as_sync_packet function --> data[0]: %d, data[1]: %d, data[2]: %d\n\r");
// keep on truckin'
usb_grow_transfer(ep->current_transfer, 1);
usb_packet_done(ep);
}
Metadata
Metadata
Assignees
Labels
No labels