summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-11-29 14:26:13 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-11-29 14:31:36 -0600
commit0d58d12b1a99f3043ef44aa4ffc4979be3307083 (patch)
treec4f3a3fc8d27020a15f4711d89cd925b60a23032 /apps
parentc32e77afb2cc40dc2976c71c3efce268116b8fdc (diff)
downloadnuttx-0d58d12b1a99f3043ef44aa4ffc4979be3307083.tar.gz
nuttx-0d58d12b1a99f3043ef44aa4ffc4979be3307083.tar.bz2
nuttx-0d58d12b1a99f3043ef44aa4ffc4979be3307083.zip
examples/hidkbd now expects an architecture-specific USB HOST initialization function
Diffstat (limited to 'apps')
-rw-r--r--apps/ChangeLog.txt4
-rw-r--r--apps/examples/hidkbd/hidkbd_main.c29
2 files changed, 22 insertions, 11 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 87d829b39..e22bab97b 100644
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -737,3 +737,7 @@
character driver (2013-11-10).
* apps/nshlib/nsh_mntcmds.c: Mount command updates from Ken Pettit
(2013-11-17).
+ * examples/hidkbd/hidkbd_main.c: Now calls a function named
+ arch_usbhost_initialize() that must be provided by the platform-
+ specific code (2013-11-29).
+
diff --git a/apps/examples/hidkbd/hidkbd_main.c b/apps/examples/hidkbd/hidkbd_main.c
index 5fb1e282c..adee66c21 100644
--- a/apps/examples/hidkbd/hidkbd_main.c
+++ b/apps/examples/hidkbd/hidkbd_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * examples/hidkbd/null_main.c
+ * examples/hidkbd/hidkbd_main.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,7 @@
#endif
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
@@ -112,7 +112,17 @@ struct hidbkd_instream_s
* Private Data
****************************************************************************/
-static struct usbhost_connection_s *g_usbconn;
+static FAR struct usbhost_connection_s *g_usbconn;
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+/* The platform-specific code must provide a wrapper called
+ * arch_usbhost_initialize() that will perform the actual USB host
+ * initialization.
+ */
+
+FAR struct usbhost_connection_s *arch_usbhost_initialize(void);
/****************************************************************************
* Private Functions
@@ -283,16 +293,13 @@ 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.
- *
- * 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.
+ /* Then get an instance of the USB host interface. The platform-specific
+ * code must provide a wrapper called arch_usbhost_initialize() that will
+ * perform the actual USB host initialization.
*/
printf("hidkbd_main: Initialize USB host keyboard driver\n");
- g_usbconn = usbhost_initialize(0);
+ g_usbconn = arch_usbhost_initialize();
if (g_usbconn)
{
/* Start a thread to handle device connection. */