mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
usbdev/cdcacm.c: register console only for device with minor number 0
With this change, we can register several CDCACM devices where one is used as a console
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
2f58b55b4d
commit
387944b837
@@ -2963,7 +2963,10 @@ int cdcacm_classobject(int minor, FAR struct usbdev_devinfo_s *devinfo,
|
|||||||
/* Register the USB serial console */
|
/* Register the USB serial console */
|
||||||
|
|
||||||
#ifdef CONFIG_CDCACM_CONSOLE
|
#ifdef CONFIG_CDCACM_CONSOLE
|
||||||
|
if (minor == 0)
|
||||||
|
{
|
||||||
priv->serdev.isconsole = true;
|
priv->serdev.isconsole = true;
|
||||||
|
|
||||||
ret = uart_register("/dev/console", &priv->serdev);
|
ret = uart_register("/dev/console", &priv->serdev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@@ -2971,6 +2974,7 @@ int cdcacm_classobject(int minor, FAR struct usbdev_devinfo_s *devinfo,
|
|||||||
(uint16_t)-ret);
|
(uint16_t)-ret);
|
||||||
goto errout_with_class;
|
goto errout_with_class;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register the CDC/ACM TTY device */
|
/* Register the CDC/ACM TTY device */
|
||||||
|
|||||||
Reference in New Issue
Block a user