aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sercp.c13
-rw-r--r--sercp.rc8
2 files changed, 10 insertions, 11 deletions
diff --git a/sercp.c b/sercp.c
index 42a5e01..84d8992 100644
--- a/sercp.c
+++ b/sercp.c
@@ -70,7 +70,6 @@ const char* _version = "v0.3.4";
FILE *tapout_fd = NULL;
int is_outfile = 0;
int baud_rate = 0;
-int wait_us = 200;
int wait_ms = 800;
char *path;
char sercp_file[FILENAME_MAX];
@@ -176,7 +175,6 @@ void TestArgs (int argc, char *argv[])
baud_rate = atoi(optarg);
break;
case 'w':
- wait_us = atoi(optarg);
wait_ms = atoi(optarg);
break;
case 'r':
@@ -479,11 +477,10 @@ void sercpRecv(void) {
#ifdef _WIN32
ReadFile(serial_fd, p_buff, expected_len, &ulNumBytes, NULL);
len = (uint16_t)ulNumBytes;
- sleep_ms(10);
#else
len = read (serial_fd, p_buff, expected_len);
- sleep_ms(10);
#endif
+ sleep_ms(10);
p_buff += len;
expected_len -= len;
length += len;
@@ -697,6 +694,7 @@ int OpenUart() {
if (SetCommTimeouts(serial_fd, &sCommTimeouts) == 0) {
return (-1);
}
+ FlushSerialPort();
return (0);
#else
struct termios oldtio, newtio;
@@ -741,15 +739,16 @@ int OpenUart() {
cfmakeraw(&newtio);
cfsetspeed(&newtio, baud_rate);
#if defined (__APPLE__) || defined (BSD)
- // pro jabkace | CNEW_RTSCTS
- newtio.c_cflag |= CS8 | CLOCAL | CREAD | CCTS_OFLOW | CRTS_IFLOW; // CSTOPB - two stop bits NOT
+// newtio.c_cflag |= CS8 | CLOCAL | CREAD | CCTS_OFLOW | CRTS_IFLOW;
+ newtio.c_cflag |= CS8 | CLOCAL | CREAD;
#else
newtio.c_cflag |= CS8 | CLOCAL | CREAD | CRTSCTS;
#endif
newtio.c_iflag &= ~(IXON | IXOFF | IXANY);
newtio.c_oflag &= ~(OPOST);
printf ("Serial device: %s, communication speed is: %d Bd\n", SERIALDEVICE, baud_rate);
- newtio.c_cc[VMIN] = 1;
+ // http://unixwiz.net/techtips/termios-vmin-vtime.html
+ newtio.c_cc[VMIN] = 0;
newtio.c_cc[VTIME] = 0;
tcsetattr(serial_fd, TCSANOW, &newtio);
tcflush(serial_fd, TCIOFLUSH);
diff --git a/sercp.rc b/sercp.rc
index ea02ace..31d6424 100644
--- a/sercp.rc
+++ b/sercp.rc
@@ -1,8 +1,8 @@
// RC file, codepage utf-8 !!!!!
#include <windows.h> // include for version info constants
1 VERSIONINFO
-FILEVERSION 0,3,1,0
-PRODUCTVERSION 0,3,1,0
+FILEVERSION 0,3,3,0
+PRODUCTVERSION 0,3,3,0
FILETYPE VFT_APP
{
BLOCK "StringFileInfo"
@@ -10,14 +10,14 @@ FILETYPE VFT_APP
BLOCK "040904E4"
{
VALUE "CompanyName", "vym.cz"
- VALUE "FileVersion", "0.3.1"
+ VALUE "FileVersion", "0.3.3"
VALUE "FileDescription", "sercp - serial copy for ZX Spectrum"
VALUE "InternalName", "sercp"
VALUE "LegalCopyright", "GNU GPL v3 or above"
VALUE "LegalTrademarks", "Pavel Vymetálek"
VALUE "OriginalFilename", "sercp"
VALUE "ProductName", "sercp"
- VALUE "ProductVersion", "0.3.1"
+ VALUE "ProductVersion", "0.3.3"
VALUE "Build environment", "Linux: Mingw64, x86_64"
}
}