Skip to content

Commit 86080a1

Browse files
xiaoxiang781216patacongo
authored andcommitted
apps: Remove the check of CONFIG_SERIAL_TERMIOS
If the code only change c_oflag, c_iflag and c_lflag, not c_cflag in termios. Follow up the change from kernel: apache/nuttx#8843 Signed-off-by: Xiang Xiao <[email protected]>
1 parent 369c354 commit 86080a1

File tree

21 files changed

+24
-134
lines changed

21 files changed

+24
-134
lines changed

examples/modbus/modbus_main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#include <string.h>
5050
#include <unistd.h>
5151
#include <pthread.h>
52-
#include <termios.h>
5352
#include <signal.h>
5453
#include <errno.h>
5554

@@ -67,11 +66,8 @@
6766
/****************************************************************************
6867
* Pre-processor Definitions
6968
****************************************************************************/
70-
/* Configuration ************************************************************/
7169

72-
#ifndef CONFIG_SERIAL_TERMIOS
73-
# error "CONFIG_SERIAL_TERMIOS is needed by modbus example"
74-
#endif
70+
/* Configuration ************************************************************/
7571

7672
#ifndef CONFIG_EXAMPLES_MODBUS_PORT
7773
# define CONFIG_EXAMPLES_MODBUS_PORT 0

examples/modbusmaster/mbmaster_main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050

5151
/* modbus master port */
5252

53-
#ifndef CONFIG_SERIAL_TERMIOS
54-
# error "CONFIG_SERIAL_TERMIOS is needed by modbus example"
55-
#endif
56-
5753
#ifdef CONFIG_EXAMPLES_MODBUSMASTER_PORT
5854
# define MBMASTER_PORT CONFIG_EXAMPLES_MODBUSMASTER_PORT
5955
#else

examples/pty_test/pty_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ int main(int argc, FAR char *argv[])
330330
#endif
331331
}
332332

333-
#ifdef CONFIG_SERIAL_TERMIOS
334333
/* Enable \n -> \r\n conversion during write */
335334

336335
ret = tcgetattr(termpair.fd_uart, &tio);
@@ -347,7 +346,6 @@ int main(int argc, FAR char *argv[])
347346
fprintf(stderr, "ERROR: tcsetattr() failed: %d\n", errno);
348347
goto error_serial;
349348
}
350-
#endif
351349

352350
printf("Starting a new NSH Session using %s\n", buffer);
353351

interpreters/bas/bas_fs.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,7 @@ int FS_opendev(int chn, int infd, int outfd)
388388

389389
g_file[chn] = malloc(sizeof(struct FileStream));
390390
g_file[chn]->dev = 1;
391-
#ifdef CONFIG_SERIAL_TERMIOS
392391
g_file[chn]->tty = (infd == 0 ? isatty(infd) && isatty(outfd) : 0);
393-
#else
394-
g_file[chn]->tty = 1;
395-
#endif
396392
g_file[chn]->recLength = 1;
397393
g_file[chn]->infd = infd;
398394
g_file[chn]->inSize = 0;
@@ -781,12 +777,10 @@ int FS_close(int dev)
781777
return 0;
782778
}
783779

784-
#ifdef CONFIG_SERIAL_TERMIOS
785780
int FS_istty(int chn)
786781
{
787782
return (g_file[chn] && g_file[chn]->tty);
788783
}
789-
#endif
790784

791785
int FS_lock(int chn, off_t offset, off_t length, int mode, int w)
792786
{

interpreters/bas/bas_fs.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,7 @@ int FS_openbinaryChn(int chn, const char *name, int mode);
112112
int FS_freechn(void);
113113
int FS_flush(int dev);
114114
int FS_close(int dev);
115-
116-
#ifdef CONFIG_SERIAL_TERMIOS
117115
int FS_istty(int chn);
118-
#else
119-
# define FS_istty(chn) (1)
120-
#endif
121-
122116
int FS_lock(int chn, off_t offset, off_t length, int mode, int w);
123117
int FS_truncate(int chn);
124118
void FS_shellmode(int chn);

interpreters/bas/bas_token.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4163,11 +4163,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
41634163
b->yy_bs_column = 0;
41644164
}
41654165

4166-
#ifdef CONFIG_SERIAL_TERMIOS
41674166
b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0;
4168-
#else
4169-
b->yy_is_interactive = 1;
4170-
#endif
41714167

41724168
errno = oerrno;
41734169
}

logging/embedlog/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ else
130130
CFLAGS += -DENABLE_PTHREAD=0
131131
endif
132132

133-
ifeq ($(CONFIG_SERIAL_TERMIOS),y)
134-
CFLAGS += -DHAVE_TERMIOS_H
135-
else
136-
CFLAGS += -DHAVE_TERMIOS_H=0
137-
endif
138-
139133
CFLAGS += -DEL_LOG_MAX=$(CONFIG_EMBEDLOG_LOG_MAX)
140134
CFLAGS += -DEL_MEM_LINE_SIZE=$(CONFIG_EMBEDLOG_MEM_LINE_SIZE)
141135

@@ -151,6 +145,7 @@ CFLAGS += -DHAVE_ACCESS=0
151145
CFLAGS += -DENABLE_REENTRANT
152146
CFLAGS += -DENABLE_OUT_SYSLOG
153147
CFLAGS += -DHAVE_STAT
148+
CFLAGS += -DHAVE_TERMIOS_H
154149
CFLAGS += -DHAVE_UNISTD_H
155150
CFLAGS += -DHAVE_FSYNC
156151
CFLAGS += -DHAVE_FILENO

logging/nxscope/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ if LOGGING_NXSCOPE
1111

1212
config LOGGING_NXSCOPE_INTF_SERIAL
1313
bool "NxScope serial port interface support"
14-
select SERIAL_TERMIOS
1514
default n
1615
---help---
1716
For details, see logging/nxscope/nxscope_iserial.c

logging/nxscope/nxscope_iser.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@
3333

3434
#include <logging/nxscope/nxscope.h>
3535

36-
/****************************************************************************
37-
* Pre-processor Definitions
38-
****************************************************************************/
39-
40-
#ifndef CONFIG_SERIAL_TERMIOS
41-
# error Termios support must be enabled
42-
#endif
43-
4436
/****************************************************************************
4537
* Private Type Definition
4638
****************************************************************************/
@@ -214,6 +206,7 @@ int nxscope_ser_init(FAR struct nxscope_intf_s *intf,
214206

215207
tcgetattr(priv->fd, &tio);
216208

209+
#ifdef CONFIG_SERIAL_TERMIOS
217210
/* Configure a baud rate */
218211

219212
DEBUGASSERT(priv->cfg->baud > 0);
@@ -224,6 +217,7 @@ int nxscope_ser_init(FAR struct nxscope_intf_s *intf,
224217
_err("ERROR: failed to set baud rate %d\n", errno);
225218
goto errout;
226219
}
220+
#endif
227221

228222
/* Configure RAW mode */
229223

modbus/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ The NuttX-named configuration options that are available include:
110110
See also other serial settings, in particular:
111111

112112
- `CONFIG_SERIAL_TERMIOS` – Serial driver supports `termios.h` interfaces
113-
(`tcsetattr`, `tcflush`, etc.). If this is not defined, then the terminal
114-
settings (baud, parity, etc.) are not configurable at runtime; serial streams
115-
will not be flushed when closed.
113+
If this is not defined, then the terminal settings (baud, parity, etc.)
114+
are not configurable at runtime.
116115

117116
## Note
118117

0 commit comments

Comments
 (0)