usb: Ensure TERMINATE bit gets set

This commit is contained in:
Ben Gamari
2013-07-03 17:48:55 -04:00
parent 2ad4cbe087
commit 1d9119fd8a
2 changed files with 3 additions and 1 deletions

View File

@ -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,

View File

@ -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];