diff options
author | leleraffa97@hotmail.it <leleraffa97@hotmail.it> | 2017-08-23 21:18:02 +0200 |
---|---|---|
committer | leleraffa97@hotmail.it <leleraffa97@hotmail.it> | 2017-08-23 21:18:02 +0200 |
commit | 3f92d0e29700fc2da45354a4cf3e3afe5c5245c2 (patch) | |
tree | cb6def68635ff2b4e4ab30c7e8fdbdf3e730bc05 /sw/linux/src/serial.c | |
parent | Filesystem struct order (diff) | |
parent | new programmer interface for linux (diff) | |
download | z80uPC-3f92d0e29700fc2da45354a4cf3e3afe5c5245c2.tar.gz z80uPC-3f92d0e29700fc2da45354a4cf3e3afe5c5245c2.zip |
Merge remote-tracking branch 'origin/naopross' into atlas
Diffstat (limited to 'sw/linux/src/serial.c')
-rw-r--r-- | sw/linux/src/serial.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/sw/linux/src/serial.c b/sw/linux/src/serial.c deleted file mode 100644 index 564676b..0000000 --- a/sw/linux/src/serial.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "serial.h" - -int serial_connect(const char *devpath, long baudrate) -{ - int fd; - struct termios tty; - // struct termios tty_old; - - // open device - if ((fd = open(devpath, O_RDWR | O_NOCTTY)) < 0) { - return -1; - } - - // set parameters - if (tcgetattr(fd, &tty) != 0) { - return -1; - } - - // TODO: update UI or add support for custom baudrate - // cfsetospeed(&tty, - // cfsetispeed(&tty, - - tty.c_cflag &= ~PARENB; // no parity - tty.c_cflag &= ~CSTOPB; // no stop bit - tty.c_cflag |= CS8; // 8 bit data - tty.c_cflag &= ~CRTSCTS; // no flow control - - tty.c_lflag = 0; // no signaling chars, no echo, no canonical processing - tty.c_oflag = 0; // no remapping, no delays - tty.c_cc[VMIN] = 0; // no block read - tty.c_cc[VTIME] = .5; // .5 seconds read timeout - - tty.c_cflag |= CREAD | CLOCAL; // turn on read and ignore ctrl lines - tty.c_iflag &= ~(IXON | IXOFF | IXANY); // turn off s/w flow ctrl - tty.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // make raw - tty.c_oflag &= ~OPOST; // make raw - - tcflush(fd , TCIFLUSH); - // if (tcsetaddr( - - return fd; -} |