USB host library, support isochronous,bulk,interrupt and control.
Dependents: BaseUsbHost_example BaseJpegDecode_example SimpleJpegDecode_example
Import programBaseUsbHost_example
BaseUsbHost example program
Diff: BaseUsbHostCtlEp.cpp
- Revision:
- 3:ae77d63a1eda
- Parent:
- 1:3b7bc4f87a61
- Child:
- 4:d931d24c2f81
--- a/BaseUsbHostCtlEp.cpp Tue Dec 11 15:26:54 2012 +0000 +++ b/BaseUsbHostCtlEp.cpp Sun Jan 06 11:45:18 2013 +0000 @@ -1,4 +1,4 @@ -// BaseUsbHostCtlEp.cpp 2012/12/5 +// BaseUsbHostCtlEp.cpp 2013/1/2 #include "mbed.h" #include "rtos.h" #include "BaseUsbHost.h" @@ -99,7 +99,6 @@ HCTD* data_td = new_HCTD(length); TEST_ASSERT(data_td); data_td->Control |= TD_TOGGLE_1|TD_IN|TD_DI; - //data_td->Control |= TD_IN|TD_DI; setup_td->Next = reinterpret_cast<uint32_t>(data_td); HCTD* status_td = new_HCTD(); @@ -117,6 +116,9 @@ int r = wait_queue_HCTD(setup_td, 100); // wait setup stage TEST_ASSERT(r == USB_OK); + if (r != USB_OK) { + return r; + } HCTD* td = get_queue_HCTD(100); if (td == data_td) { memcpy(data, const_cast<uint8_t*>(td->buf), length); @@ -180,4 +182,3 @@ td->CurrBufPtr = td->setup; td->BufEnd = td->setup+8-1; } -