You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/08/08 11:26:04 UTC

[nuttx] branch master updated: composite: add COMPOSITE_DEVICES config for composite device

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 5af40a6fa4 composite: add COMPOSITE_DEVICES config for composite device
5af40a6fa4 is described below

commit 5af40a6fa4e04b8e6e7df56139211755866cfad5
Author: zhangyuan21 <zh...@xiaomi.com>
AuthorDate: Tue Aug 8 14:54:48 2023 +0800

    composite: add COMPOSITE_DEVICES config for composite device
    
    Add COMPOSITE_DEVICES configuration so that external composite
    devices can also know the maximum number of supported classes.
    The default COMPOSITE_DEVICES number is 8.
    
    Signed-off-by: zhangyuan21 <zh...@xiaomi.com>
---
 drivers/usbdev/Kconfig     | 6 ++++++
 drivers/usbdev/composite.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usbdev/Kconfig b/drivers/usbdev/Kconfig
index e1642858c7..d9b855ee46 100644
--- a/drivers/usbdev/Kconfig
+++ b/drivers/usbdev/Kconfig
@@ -265,6 +265,12 @@ config COMPOSITE_MSFT_OS_DESCRIPTORS
 		Enabling this feature in composite driver will pass these requests
 		onwards to the interface drivers.
 
+config COMPOSITE_DEVICES
+	int "Max class object for composite device"
+	default 8
+	---help---
+		Composite device class object number.
+
 endif
 
 config PL2303
diff --git a/drivers/usbdev/composite.h b/drivers/usbdev/composite.h
index 308501579c..f98bb595d0 100644
--- a/drivers/usbdev/composite.h
+++ b/drivers/usbdev/composite.h
@@ -40,7 +40,7 @@
  ****************************************************************************/
 
 #ifdef CONFIG_USBDEV_COMPOSITE
-#  define NUM_DEVICES_TO_HANDLE       (8)
+#  define NUM_DEVICES_TO_HANDLE       (CONFIG_COMPOSITE_DEVICES)
 #else
 #  define NUM_DEVICES_TO_HANDLE       (1)
 #endif