Simple USBHost WebCam for EA LPC4088 QSB/LPC1768 test program

Dependencies:   LPC4088-USBHost mbed

EA LPC4088 QSB/LPC1768をUSBホストにしてWebカメラからJPEG画像を読み取るテストプログラムです。

The usage is the same as KL46Z-USBHostC270_example.
使い方はKL46Z-USBHostC270_exampleと同じです。
動作確認: Logitech C270,Logitech Q200R(Qcam Orbit AF)
/media/uploads/va009039/lpc4088-c270-480x360.jpg

Committer:
va009039
Date:
Thu Apr 24 05:38:45 2014 +0000
Revision:
0:c972ee42b455
first commit,sync rev.29.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:c972ee42b455 1 /* mbed USBHost Library
va009039 0:c972ee42b455 2 * Copyright (c) 2006-2013 ARM Limited
va009039 0:c972ee42b455 3 *
va009039 0:c972ee42b455 4 * Licensed under the Apache License, Version 2.0 (the "License");
va009039 0:c972ee42b455 5 * you may not use this file except in compliance with the License.
va009039 0:c972ee42b455 6 * You may obtain a copy of the License at
va009039 0:c972ee42b455 7 *
va009039 0:c972ee42b455 8 * http://www.apache.org/licenses/LICENSE-2.0
va009039 0:c972ee42b455 9 *
va009039 0:c972ee42b455 10 * Unless required by applicable law or agreed to in writing, software
va009039 0:c972ee42b455 11 * distributed under the License is distributed on an "AS IS" BASIS,
va009039 0:c972ee42b455 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
va009039 0:c972ee42b455 13 * See the License for the specific language governing permissions and
va009039 0:c972ee42b455 14 * limitations under the License.
va009039 0:c972ee42b455 15 */
va009039 0:c972ee42b455 16
va009039 0:c972ee42b455 17 #include "USBHost.h"
va009039 0:c972ee42b455 18 #include "BaseUsbHostDebug.h"
va009039 0:c972ee42b455 19 #include "USBEndpoint.h"
va009039 0:c972ee42b455 20 #include "BaseUsbHostTest.h"
va009039 0:c972ee42b455 21
va009039 0:c972ee42b455 22 HCTD* USBEndpoint::get_queue_HCTD(uint32_t millisec)
va009039 0:c972ee42b455 23 {
va009039 0:c972ee42b455 24 for(int i = 0; i < 16; i++) {
va009039 0:c972ee42b455 25 osEvent evt = m_queue.get(millisec);
va009039 0:c972ee42b455 26 if (evt.status == osEventMessage) {
va009039 0:c972ee42b455 27 HCTD* td = reinterpret_cast<HCTD*>(evt.value.p);
va009039 0:c972ee42b455 28 TEST_ASSERT(td);
va009039 0:c972ee42b455 29 uint8_t cc = td->ConditionCode();
va009039 0:c972ee42b455 30 if (cc != 0) {
va009039 0:c972ee42b455 31 m_ConditionCode = cc;
va009039 0:c972ee42b455 32 DBG_TD(td);
va009039 0:c972ee42b455 33 }
va009039 0:c972ee42b455 34 return td;
va009039 0:c972ee42b455 35 } else if (evt.status == osOK) {
va009039 0:c972ee42b455 36 continue;
va009039 0:c972ee42b455 37 } else if (evt.status == osEventTimeout) {
va009039 0:c972ee42b455 38 return NULL;
va009039 0:c972ee42b455 39 } else {
va009039 0:c972ee42b455 40 DBG("evt.status: %02x\n", evt.status);
va009039 0:c972ee42b455 41 TEST_ASSERT(evt.status == osEventMessage);
va009039 0:c972ee42b455 42 }
va009039 0:c972ee42b455 43 }
va009039 0:c972ee42b455 44 return NULL;
va009039 0:c972ee42b455 45 }
va009039 0:c972ee42b455 46
va009039 0:c972ee42b455 47