Compare commits

...

2 Commits

Author SHA1 Message Date
Olaf Rempel 7d74f62c00 butterfly_prog: Fix serial initalization 2020-10-20 23:56:31 +02:00
Olaf Rempel 9192149be2 Rename source files 2020-10-18 18:45:02 +02:00
4 changed files with 7 additions and 6 deletions

View File

@ -238,9 +238,6 @@ static uint32_t butterfly_get_memsize(struct multiboot * p_mboot,
* ************************************************************************* */
static void butterfly_close_device(bfly_privdata_t * p_priv)
{
/* delay close() / tcsetattr() */
usleep(100000);
tcsetattr(p_priv->fd, TCSANOW, &p_priv->oldtio);
close(p_priv->fd);
} /* butterfly_close_device */
@ -268,9 +265,10 @@ static int butterfly_open_device(bfly_privdata_t * p_priv)
struct termios newtio;
memset(&newtio, 0, sizeof(newtio));
newtio.c_iflag |= IGNBRK;
newtio.c_cflag |= SERIAL_BAUDRATE | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNBRK;
newtio.c_cflag = (CS8 | CREAD | CLOCAL);
cfsetispeed(&newtio, SERIAL_BAUDRATE);
cfsetospeed(&newtio, SERIAL_BAUDRATE);
newtio.c_cc[VMIN] = 1;
newtio.c_cc[VTIME] = 0;
@ -282,6 +280,9 @@ static int butterfly_open_device(bfly_privdata_t * p_priv)
return -1;
}
/* needed for some slow USB2Serial adapters */
usleep(200000);
return 0;
} /* butterlfy_open_device */

View File

View File

View File