diff options
author | Pavel Vymetálek <pavel@vym.cz> | 2020-04-08 13:57:02 +0200 |
---|---|---|
committer | Pavel Vymetálek <pavel@vym.cz> | 2020-04-08 13:57:02 +0200 |
commit | 6183b533da086307d4198ac30d8c76f81086c48f (patch) | |
tree | a70fc42757d363613a5f79724423df8c0630d7c9 | |
parent | 4fb0f336df691b6fb55c38c1128b63d94fc4e1d3 (diff) | |
download | sercp-pc-6183b533da086307d4198ac30d8c76f81086c48f.tar.gz |
Drop hardware flow control for BSD and MAC builds - use -w 2000 parameter
-rw-r--r-- | sercp.c | 13 | ||||
-rw-r--r-- | sercp.rc | 8 |
2 files changed, 10 insertions, 11 deletions
@@ -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); @@ -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" } } |