diff options
| author | JasonJiaJie <[email protected]> | 2017-12-07 11:06:10 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2017-12-07 18:32:06 +0800 |
| commit | de0a201e4490d2692e91768a2acb619680d3b89d (patch) | |
| tree | 1894c141d02167b4389cc06a29aa8aeb39fd8d07 /components/libc | |
| parent | 049ed5047f49c8662933c51c12e9281daf24f836 (diff) | |
[Termios]1. Add termios test. 2.Add termios.h
1. Add termios test. 2.Add termios.h
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/armlibc/termios.h | 7 | ||||
| -rw-r--r-- | components/libc/termios/posix_termios.c | 14 |
2 files changed, 13 insertions, 8 deletions
diff --git a/components/libc/compilers/armlibc/termios.h b/components/libc/compilers/armlibc/termios.h new file mode 100644 index 0000000000..0b54066a76 --- /dev/null +++ b/components/libc/compilers/armlibc/termios.h @@ -0,0 +1,7 @@ +#ifndef _TERMIOS_H__ +#define _TERMIOS_H__ + +#include <sys/types.h> +#include <posix_termios.h> + +#endif diff --git a/components/libc/termios/posix_termios.c b/components/libc/termios/posix_termios.c index 4ec513ef1d..4f7417cb27 100644 --- a/components/libc/termios/posix_termios.c +++ b/components/libc/termios/posix_termios.c @@ -28,8 +28,6 @@ #include <termios.h> -#include "posix_termios.h" - int tcgetattr(int fd, struct termios *tio) { /* Get the current serial port settings. */ @@ -41,20 +39,20 @@ int tcgetattr(int fd, struct termios *tio) int tcsetattr(int fd, int act, const struct termios *tio) { - switch (act) + switch (act) { case TCSANOW: /* make the change immediately */ return (ioctl(fd, TCSETA, (void*)tio)); case TCSADRAIN: /* - * Don't make the change until all currently written data + * Don't make the change until all currently written data * has been transmitted. */ return (ioctl(fd, TCSETAW, (void*)tio)); case TCSAFLUSH: - /* Don't make the change until all currently written data - * has been transmitted, at which point any received but + /* Don't make the change until all currently written data + * has been transmitted, at which point any received but * unread data is also discarded. */ return (ioctl(fd, TCSETAF, (void*)tio)); @@ -65,7 +63,7 @@ int tcsetattr(int fd, int act, const struct termios *tio) } /** - * this function gets process group ID for session leader for controlling + * this function gets process group ID for session leader for controlling * terminal * * @return always 0 @@ -87,7 +85,7 @@ speed_t cfgetispeed(const struct termios *tio) int cfsetospeed(struct termios *tio, speed_t speed) { - if (speed & ~CBAUD) + if (speed & ~CBAUD) { errno = EINVAL; return -1; |
