diff --git a/firmware/hackrf_usb/usb.c b/firmware/hackrf_usb/usb.c index a44d9164..472e5eb5 100644 --- a/firmware/hackrf_usb/usb.c +++ b/firmware/hackrf_usb/usb.c @@ -218,7 +218,8 @@ void usb_endpoint_schedule_wait( // Schedule an already filled-in transfer descriptor for execution on // the given endpoint, appending to the end of the endpoint's queue if // there are pending TDs. Note that this requires that one knows the -// tail of the endpoint's TD queue +// tail of the endpoint's TD queue. Moreover, the user is responsible +// for setting the TERMINATE bit of next_dtd_pointer if needed. void usb_endpoint_schedule_append( const usb_endpoint_t* const endpoint, usb_transfer_descriptor_t* const tail_td, diff --git a/firmware/hackrf_usb/usb_queue.c b/firmware/hackrf_usb/usb_queue.c index 853ace75..dc8ec2eb 100644 --- a/firmware/hackrf_usb/usb_queue.c +++ b/firmware/hackrf_usb/usb_queue.c @@ -137,6 +137,7 @@ void usb_transfer_schedule( usb_transfer_t* const transfer = allocate_transfer(); uint_fast8_t index = USB_ENDPOINT_INDEX(endpoint->address); fill_in_transfer(transfer, data, maximum_length); + transfer->td.next_dtd_pointer = USB_TD_NEXT_DTD_POINTER_TERMINATE; transfer->completion_cb = completion_cb; // TODO: disable_interrupts(); usb_transfer_t* tail = endpoint_transfers[index];