Make use of baudrate 0 as indicator of default baudrate, show error when trying to use unsupported baudrate

This commit is contained in:
Krystian Dużyński 2020-08-12 00:24:11 +02:00
parent 965ff443c8
commit d24b257c13
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ cfg_init(void)
strncpy(cfg.logname, LOGNAME, INTBUFSIZE);
#endif
strncpy(cfg.ttyport, DEFAULT_PORT, INTBUFSIZE);
cfg.ttyspeed = DEFAULT_SPEED;
cfg.ttyspeed = 0;
strncpy(cfg.ttymode, DEFAULT_MODE, INTBUFSIZE);
#ifdef TRXCTL
cfg.trxcntl = TRX_ADDC;

View File

@ -201,7 +201,7 @@ tty_transpeed(int speed)
switch (speed)
{
case 0:
tspeed = B0;
tspeed = DEFAULT_BSPEED;
break;
#if defined(B50)
case 50:
@ -312,8 +312,8 @@ tty_transpeed(int speed)
break;
#endif
default:
tspeed = DEFAULT_BSPEED;
break;
logw(2, "unsupported baudrate (%d)", speed);
exit (-1);
}
return tspeed;
}