diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-11-29 14:26:13 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-11-29 14:31:36 -0600 |
commit | 0d58d12b1a99f3043ef44aa4ffc4979be3307083 (patch) | |
tree | c4f3a3fc8d27020a15f4711d89cd925b60a23032 /apps/examples/hidkbd/hidkbd_main.c | |
parent | c32e77afb2cc40dc2976c71c3efce268116b8fdc (diff) | |
download | px4-nuttx-0d58d12b1a99f3043ef44aa4ffc4979be3307083.tar.gz px4-nuttx-0d58d12b1a99f3043ef44aa4ffc4979be3307083.tar.bz2 px4-nuttx-0d58d12b1a99f3043ef44aa4ffc4979be3307083.zip |
examples/hidkbd now expects an architecture-specific USB HOST initialization function
Diffstat (limited to 'apps/examples/hidkbd/hidkbd_main.c')
-rw-r--r-- | apps/examples/hidkbd/hidkbd_main.c | 29 |
1 files changed, 18 insertions, 11 deletions
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. */ |