examples/hidkbd now expects an architecture-specific USB HOST initialization function
This commit is contained in:
parent
36345c7234
commit
9f487677d2
@ -737,3 +737,7 @@
|
|||||||
character driver (2013-11-10).
|
character driver (2013-11-10).
|
||||||
* apps/nshlib/nsh_mntcmds.c: Mount command updates from Ken Pettit
|
* apps/nshlib/nsh_mntcmds.c: Mount command updates from Ken Pettit
|
||||||
(2013-11-17).
|
(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).
|
||||||
|
|
||||||
|
@ -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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -59,7 +59,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
@ -112,7 +112,17 @@ struct hidbkd_instream_s
|
|||||||
* Private Data
|
* 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
|
* Private Functions
|
||||||
@ -283,16 +293,13 @@ int hidkbd_main(int argc, char *argv[])
|
|||||||
printf("hidkbd_main: Failed to register the KBD class\n");
|
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. The platform-specific
|
||||||
*
|
* code must provide a wrapper called arch_usbhost_initialize() that will
|
||||||
* REVISIT: This logic needs to be modified. There must be a call-out to
|
* perform the actual USB host initialization.
|
||||||
* 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");
|
printf("hidkbd_main: Initialize USB host keyboard driver\n");
|
||||||
g_usbconn = usbhost_initialize(0);
|
g_usbconn = arch_usbhost_initialize();
|
||||||
if (g_usbconn)
|
if (g_usbconn)
|
||||||
{
|
{
|
||||||
/* Start a thread to handle device connection. */
|
/* Start a thread to handle device connection. */
|
||||||
|
Loading…
Reference in New Issue
Block a user