summaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-08-13 17:43:19 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-08-13 17:43:19 -0600
commit2cf667980a218cc0dde8413c44a7e9cd17315e34 (patch)
tree2932017f70ce2a86573db3a68a7ea32e94ab7026 /apps/examples
parente586e9273bbedeb3fc57998660d5869752fea68d (diff)
downloadnuttx-2cf667980a218cc0dde8413c44a7e9cd17315e34.tar.gz
nuttx-2cf667980a218cc0dde8413c44a7e9cd17315e34.tar.bz2
nuttx-2cf667980a218cc0dde8413c44a7e9cd17315e34.zip
Clean up some LP17xx and STM32 USB host configuration compilation errors due to the massive changes to the USB host interfaces needed to support the SAMA5
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/hidkbd/hidkbd_main.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/apps/examples/hidkbd/hidkbd_main.c b/apps/examples/hidkbd/hidkbd_main.c
index 9ddbc3e6a..5fb1e282c 100644
--- a/apps/examples/hidkbd/hidkbd_main.c
+++ b/apps/examples/hidkbd/hidkbd_main.c
@@ -112,7 +112,7 @@ struct hidbkd_instream_s
* Private Data
****************************************************************************/
-static struct usbhost_driver_s *g_drvr;
+static struct usbhost_connection_s *g_usbconn;
/****************************************************************************
* Private Functions
@@ -224,15 +224,21 @@ static void hidkbd_decode(FAR char *buffer, ssize_t nbytes)
static int hidkbd_waiter(int argc, char *argv[])
{
bool connected = false;
- int ret;
+ int rhpndx;
printf("hidkbd_waiter: Running\n");
for (;;)
{
- /* Wait for the device to change state */
+ /* Wait for the device to change state.
+ *
+ * REVISIT: This will not handle USB implementations (such as the the
+ * SAMA5) which have multiple downstream, root hub ports. In such cases,
+ * connected must be an array with dimension equal to the number of root
+ * hub ports.
+ */
- ret = DRVR_WAIT(g_drvr, connected);
- DEBUGASSERT(ret == OK);
+ rhpndx = CONN_WAIT(g_usbconn, &connected);
+ DEBUGASSERT(rhpndx == OK);
connected = !connected;
printf("hidkbd_waiter: %s\n", connected ? "connected" : "disconnected");
@@ -243,7 +249,7 @@ static int hidkbd_waiter(int argc, char *argv[])
{
/* Yes.. enumerate the newly connected device */
- (void)DRVR_ENUMERATE(g_drvr);
+ (void)CONN_ENUMERATE(g_usbconn, rhpndx);
}
}
@@ -277,11 +283,17 @@ int hidkbd_main(int argc, char *argv[])
printf("hidkbd_main: Failed to register the KBD class\n");
}
- /* Then get an instance of the USB host interface */
+ /* Then get an instance of the USB host interface.
+ *
+ * REVISIT: This logic needs to be modified. There must be a call-out to
+ * platform specific logic to get the connection hangle. usbhost_initialize()
+ * is not longer common to all platforms and is no longer prototyped in
+ * include/nuttx/usb/usbhost.h.
+ */
printf("hidkbd_main: Initialize USB host keyboard driver\n");
- g_drvr = usbhost_initialize(0);
- if (g_drvr)
+ g_usbconn = usbhost_initialize(0);
+ if (g_usbconn)
{
/* Start a thread to handle device connection. */