Fix a few issues related to new USB device boardctl() commands
This commit is contained in:
parent
54f71c20fe
commit
55407013ea
@ -50,9 +50,9 @@
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_USBDEVCTRL
|
||||
# include <nuttx/usbdev/cdcacm.h>
|
||||
# include <nuttx/usbdev/usbmsc.h>
|
||||
# include <nuttx/usbdev/composite.h>
|
||||
# include <nuttx/usb/cdcacm.h>
|
||||
# include <nuttx/usb/usbmsc.h>
|
||||
# include <nuttx/usb/composite.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LIB_BOARDCTL
|
||||
@ -83,7 +83,7 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl)
|
||||
|
||||
switch (ctrl->usbdev)
|
||||
{
|
||||
#if defined(CONFIG_CDCACM) && !defined(CONFIG_CDCACM_COMPOSITE)
|
||||
#ifdef CONFIG_CDCACM
|
||||
case BOARDIOC_USBDEV_CDCACM: /* CDC/ACM, not in a composite */
|
||||
switch (ctrl->action)
|
||||
{
|
||||
@ -91,16 +91,18 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl)
|
||||
break; /* There is no CDC/ACM initialization */
|
||||
|
||||
case BOARDIOC_USBDEV_CONNECT: /* Connect the CDC/ACM device */
|
||||
#ifndef CONFIG_CDCACM_COMPOSITE
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL);
|
||||
ret = cdcacm_initialize(ctrl->instance, ctrl->handle);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BOARDIOC_USBDEV_DISCONNECT: /* Disconnect the CDC/ACM device */
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL);
|
||||
cdcacm_uninitialize(ctrl->handle);
|
||||
DEBUGASSERT(ctrl->handle != NULL && *ctrl->handle != NULL);
|
||||
cdcacm_uninitialize(*ctrl->handle);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -110,7 +112,7 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_USBMSC) && !defined(CONFIG_USBMSC_COMPOSITE)
|
||||
#ifdef CONFIG_USBMSC
|
||||
case BOARDIOC_USBDEV_MSC: /* Mass storage class */
|
||||
switch (ctrl->action)
|
||||
{
|
||||
@ -130,8 +132,8 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl)
|
||||
|
||||
case BOARDIOC_USBDEV_DISCONNECT: /* Disconnect the USB MSC device */
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL);
|
||||
usbmsc_uninitialize(ctrl->handle);
|
||||
DEBUGASSERT(ctrl->handle != NULL && *ctrl->handle != NULL);
|
||||
usbmsc_uninitialize(*ctrl->handle);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -154,8 +156,8 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl)
|
||||
case BOARDIOC_USBDEV_CONNECT: /* Connect the Composite device */
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL);
|
||||
*(ctrl->handle) = composite_initialize();
|
||||
if (ctrl->handle == NULL)
|
||||
*ctrl->handle = composite_initialize();
|
||||
if (*ctrl->handle == NULL)
|
||||
{
|
||||
ret = -EIO;
|
||||
}
|
||||
@ -164,8 +166,8 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl)
|
||||
|
||||
case BOARDIOC_USBDEV_DISCONNECT: /* Disconnect the Composite device */
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL);
|
||||
composite_uninitialize(ctrl->handle);
|
||||
DEBUGASSERT(ctrl->handle != NULL && *ctrl->handle != NULL);
|
||||
composite_uninitialize(*ctrl->handle);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -80,6 +80,7 @@ CONFIG_ARCH="arm"
|
||||
# CONFIG_ARCH_CHIP_DM320 is not set
|
||||
# CONFIG_ARCH_CHIP_EFM32 is not set
|
||||
# CONFIG_ARCH_CHIP_IMX1 is not set
|
||||
# CONFIG_ARCH_CHIP_IMX6 is not set
|
||||
# CONFIG_ARCH_CHIP_KINETIS is not set
|
||||
# CONFIG_ARCH_CHIP_KL is not set
|
||||
# CONFIG_ARCH_CHIP_LM is not set
|
||||
@ -98,6 +99,7 @@ CONFIG_ARCH="arm"
|
||||
# CONFIG_ARCH_CHIP_SAMV7 is not set
|
||||
CONFIG_ARCH_CHIP_STM32=y
|
||||
# CONFIG_ARCH_CHIP_STM32F7 is not set
|
||||
# CONFIG_ARCH_CHIP_STM32L4 is not set
|
||||
# CONFIG_ARCH_CHIP_STR71X is not set
|
||||
# CONFIG_ARCH_CHIP_TMS570 is not set
|
||||
# CONFIG_ARCH_CHIP_MOXART is not set
|
||||
@ -126,6 +128,7 @@ CONFIG_ARCH_HAVE_CMNVECTOR=y
|
||||
CONFIG_ARCH_HAVE_FPU=y
|
||||
# CONFIG_ARCH_HAVE_DPFPU is not set
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
# CONFIG_ARCH_HAVE_TRUSTZONE is not set
|
||||
CONFIG_ARM_HAVE_MPU_UNIFIED=y
|
||||
# CONFIG_ARM_MPU is not set
|
||||
|
||||
@ -534,6 +537,7 @@ CONFIG_NSH_MMCSDMINOR=0
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
# CONFIG_BOARDCTL_RESET is not set
|
||||
# CONFIG_BOARDCTL_UNIQUEID is not set
|
||||
CONFIG_BOARDCTL_USBDEVCTRL=y
|
||||
# CONFIG_BOARDCTL_TSCTEST is not set
|
||||
# CONFIG_BOARDCTL_ADCTEST is not set
|
||||
# CONFIG_BOARDCTL_PWMTEST is not set
|
||||
@ -784,8 +788,8 @@ CONFIG_CDCACM_EPBULKOUT_HSSIZE=512
|
||||
CONFIG_CDCACM_EPBULKIN=2
|
||||
CONFIG_CDCACM_EPBULKIN_FSSIZE=64
|
||||
CONFIG_CDCACM_EPBULKIN_HSSIZE=512
|
||||
CONFIG_CDCACM_NWRREQS=4
|
||||
CONFIG_CDCACM_NRDREQS=4
|
||||
CONFIG_CDCACM_NWRREQS=4
|
||||
CONFIG_CDCACM_BULKIN_REQLEN=96
|
||||
CONFIG_CDCACM_RXBUFSIZE=256
|
||||
CONFIG_CDCACM_TXBUFSIZE=256
|
||||
@ -915,6 +919,8 @@ CONFIG_ARCH_LOWPUTC=y
|
||||
CONFIG_LIB_SENDFILE_BUFSIZE=512
|
||||
# CONFIG_ARCH_ROMGETC is not set
|
||||
# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
|
||||
CONFIG_ARCH_HAVE_TLS=y
|
||||
# CONFIG_TLS is not set
|
||||
# CONFIG_LIBC_NETDB is not set
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user