USB host library, support isochronous,bulk,interrupt and control.
Dependents: BaseUsbHost_example BaseJpegDecode_example SimpleJpegDecode_example
Import programBaseUsbHost_example
BaseUsbHost example program
Diff: BaseUsbHostUvc.cpp
- Revision:
- 2:fe1e62051d88
- Parent:
- 1:3b7bc4f87a61
- Child:
- 3:ae77d63a1eda
--- a/BaseUsbHostUvc.cpp Wed Dec 05 13:23:06 2012 +0000 +++ b/BaseUsbHostUvc.cpp Tue Dec 11 15:26:54 2012 +0000 @@ -1,4 +1,4 @@ -// BaseUsbHostUvc.cpp 2012/12/5 +// BaseUsbHostUvc.cpp 2012/12/11 #include "mbed.h" #include "rtos.h" #include "BaseUsbHost.h" @@ -7,18 +7,20 @@ #define TEST #include "BaseUsbHostTest.h" -void BaseUvc::poll() +void BaseUvc::poll(int millisec) { - HCITD* itd = m_isoEp->isochronousReveive(); + HCITD* itd = m_isoEp->isochronousReveive(millisec); if (itd) { uint8_t cc = itd->Control>>28; report_cc_count[cc]++; if (cc == 0) { // ConditionCode //DBG_ITD(itd); uint16_t frame = itd->Control & 0xffff; + int fc = ((itd->Control>>24)&7)+1; + TEST_ASSERT(fc == m_isoEp->m_FrameCount); uint8_t* buf = const_cast<uint8_t*>(itd->buf); int mps = m_isoEp->m_PacketSize; - for(int i = 0; i < m_isoEp->m_FrameCount; i++) { + for(int i = 0; i < fc; i++) { uint16_t pswn = itd->OffsetPSW[i]; cc = pswn>>12; if (cc == 0 || cc == 9) {