dlizewski commented on code in PR #18815:
URL: https://github.com/apache/nuttx/pull/18815#discussion_r3156709150
##########
drivers/usbhost/usbhost_enumerate.c:
##########
@@ -454,14 +455,22 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport,
DRVR_EP0CONFIGURE(hport->drvr, hport->ep0, hport->funcaddr,
hport->speed, maxpacketsize);
- /* Get the configuration descriptor (only), index == 0. Should not be
- * hard-coded! More logic is needed in order to handle devices with
- * multiple configurations.
+#ifdef CONFIG_USBHOST_CONFIGURATION_SELECTION
+ /* Board specific callback to choose which configuration to use for
+ * this device. Supplied by board file
*/
+ cfgidx = usbhost_select_configuration(hport,
+ (struct usb_devdesc_s *)buffer, &id);
+#else
+ cfgidx = 0;
Review Comment:
done
##########
drivers/usbhost/CMakeLists.txt:
##########
@@ -47,6 +47,10 @@ if(CONFIG_USBHOST)
list(APPEND SRCS usbhost_cdcacm.c)
endif()
+ if(CONFIG_USBHOST_CDCECM)
+ list(APPEND SRCS usbhost_cdcacm.c)
Review Comment:
fixed, good catch
##########
drivers/usbhost/usbhost_cdcecm.c:
##########
@@ -0,0 +1,2160 @@
+/****************************************************************************
+ * drivers/usbhost/usbhost_cdcecm.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <semaphore.h>
+#include <assert.h>
+#include <errno.h>
+#include <debug.h>
+#include <poll.h>
+#include <fcntl.h>
+
+#include <arpa/inet.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/irq.h>
+#include <nuttx/kmalloc.h>
+#include <nuttx/kthread.h>
+#include <nuttx/mutex.h>
+#include <nuttx/fs/fs.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/signal.h>
+#include <nuttx/net/netdev.h>
+
+#include <nuttx/usb/cdc.h>
+#include <nuttx/usb/usb.h>
+#include <nuttx/usb/usbhost.h>
+
+#ifdef CONFIG_NET_PKT
+ #include <nuttx/net/pkt.h>
+#endif
+
+#ifdef CONFIG_USBHOST_CDCECM
Review Comment:
deleted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]