mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +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
+10
-6
@@ -2963,13 +2963,17 @@ int cdcacm_classobject(int minor, FAR struct usbdev_devinfo_s *devinfo,
|
||||
/* Register the USB serial console */
|
||||
|
||||
#ifdef CONFIG_CDCACM_CONSOLE
|
||||
priv->serdev.isconsole = true;
|
||||
ret = uart_register("/dev/console", &priv->serdev);
|
||||
if (ret < 0)
|
||||
if (minor == 0)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_CONSOLEREGISTER),
|
||||
(uint16_t)-ret);
|
||||
goto errout_with_class;
|
||||
priv->serdev.isconsole = true;
|
||||
|
||||
ret = uart_register("/dev/console", &priv->serdev);
|
||||
if (ret < 0)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_CONSOLEREGISTER),
|
||||
(uint16_t)-ret);
|
||||
goto errout_with_class;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user