mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
nxscope/serial: ignore baud configuration if set to 0
This commit is contained in:
parent
85eb37c62b
commit
f505b6cb08
3 changed files with 12 additions and 9 deletions
|
|
@ -207,15 +207,16 @@ int nxscope_ser_init(FAR struct nxscope_intf_s *intf,
|
|||
tcgetattr(priv->fd, &tio);
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
/* Configure a baud rate */
|
||||
|
||||
DEBUGASSERT(priv->cfg->baud > 0);
|
||||
|
||||
ret = cfsetspeed(&tio, priv->cfg->baud);
|
||||
if (ret < 0)
|
||||
if (priv->cfg->baud > 0)
|
||||
{
|
||||
_err("ERROR: failed to set baud rate %d\n", errno);
|
||||
goto errout;
|
||||
/* Configure a baud rate */
|
||||
|
||||
ret = cfsetspeed(&tio, priv->cfg->baud);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: failed to set baud rate %d\n", errno);
|
||||
goto errout;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue