BaseUsbHost example program
Dependencies: BaseUsbHost FATFileSystem mbed mbed-rtos
Diff: LogitechC270/LogitechC270.cpp
- Revision:
- 2:c10029b87439
- Parent:
- 1:80205a2de336
- Child:
- 3:6ae9a03a6145
--- a/LogitechC270/LogitechC270.cpp Wed Dec 05 13:25:18 2012 +0000 +++ b/LogitechC270/LogitechC270.cpp Tue Dec 11 15:28:00 2012 +0000 @@ -1,4 +1,4 @@ -// LogitechC270.cpp 2012/12/5 +// LogitechC270.cpp 2012/12/11 #include "mbed.h" #include "rtos.h" #include "BaseUsbHost.h" @@ -62,31 +62,30 @@ TEST_ASSERT_EQUAL(*reinterpret_cast<uint32_t*>(buf+4), interval); DBG_BYTES("GET_CUR Commit", buf, 26); - int cfg; - rc = m_ctlEp->GetConfiguration(&cfg); + int value; + rc = m_ctlEp->GetConfiguration(&value); TEST_ASSERT_EQUAL(rc, USB_OK); - DBG("config: %d\n", cfg); + DBG("config: %d\n", value); rc = m_ctlEp->SetConfiguration(1); TEST_ASSERT_EQUAL(rc, USB_OK); - rc = m_ctlEp->GetConfiguration(&cfg); + rc = m_ctlEp->GetConfiguration(&value); TEST_ASSERT_EQUAL(rc, USB_OK); - DBG("config: %d\n", cfg); - TEST_ASSERT_EQUAL(cfg, 1); + DBG("config: %d\n", value); + TEST_ASSERT_EQUAL(value, 1); - int alt; - rc = m_ctlEp->GetInterface(1, &alt); + rc = m_ctlEp->GetInterface(1, &value); TEST_ASSERT_EQUAL(rc, USB_OK); - DBG("alt: %d\n", alt); + DBG("alt: %d\n", value); rc = m_ctlEp->SetInterfaceAlternate(1, C270_IF_ALT); // alt=1 packet size = 192 TEST_ASSERT_EQUAL(rc, USB_OK); - rc = m_ctlEp->GetInterface(1, &alt); + rc = m_ctlEp->GetInterface(1, &value); TEST_ASSERT_EQUAL(rc, USB_OK); - DBG("alt: %d\n", alt); - TEST_ASSERT_EQUAL(alt, 1); + DBG("alt: %d\n", value); + TEST_ASSERT_EQUAL(value, C270_IF_ALT); for(int i = 0; i < 16; i++) { report_cc_count[i] = 0; @@ -125,4 +124,3 @@ } return false; } -