summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Vymetalek <pavel@vym.cz>2015-07-18 16:58:23 -0400
committerPavel Vymetalek <pavel@vym.cz>2015-07-18 16:58:23 -0400
commit671ad5d27057217faad7645ebacfdbe37b975794 (patch)
treed1398438ed82a07e4545bdac03f24203d31583c6
parentaabf4d86a7fe5c4d48e440e8d4a1b05dadc6ea7a (diff)
downloadtaptoserial-671ad5d27057217faad7645ebacfdbe37b975794.tar.gz
Pridana rychlost 57600Bd
-rw-r--r--taptoser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/taptoser.c b/taptoser.c
index 3985022..20b962e 100644
--- a/taptoser.c
+++ b/taptoser.c
@@ -100,7 +100,7 @@ void TestArgs (int argc, char *argv[])
break;
}
}
- if (baud_rate != 9600 && baud_rate != 19200) baud_rate = 19200;
+// if (baud_rate != 9600 && baud_rate != 19200) baud_rate = 19200;
/* Done with options. OPTIND points to first nonoption argument. */
if (optind < argc) {
while (optind < argc){
@@ -208,6 +208,9 @@ int main(int argc, char** argv, char** env)
tcgetattr(serial_fd, &oldtio); /* save current port settings */
switch (baud_rate){
default:
+ case 57600:
+ newtio.c_cflag = B57600 | CS8 | CLOCAL | CREAD | CSTOPB | CRTSCTS;
+ break;
case 19200:
newtio.c_cflag = B19200 | CS8 | CLOCAL | CREAD | CSTOPB | CRTSCTS;
break;
@@ -226,7 +229,6 @@ int main(int argc, char** argv, char** env)
tcsetattr(serial_fd, TCSANOW, &newtio);
Set_DTR(true);
-
no = stat(tap_file, &st);
if (no != 0)
{
@@ -243,6 +245,7 @@ int main(int argc, char** argv, char** env)
while (pos < st.st_size)
{
+
pos += no = fread(header, 1, 2, fd);
if (no != 2)
tooshort(fd);