aboutsummaryrefslogtreecommitdiff
path: root/sercp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sercp.c')
-rw-r--r--sercp.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sercp.c b/sercp.c
index 8d9d0a0..d119af4 100644
--- a/sercp.c
+++ b/sercp.c
@@ -68,7 +68,7 @@
#define FALSE 0
#define true 1
#define TRUE 1
-const char* _version = "v0.8.1";
+const char* _version = "v0.8.2";
// SERIAL
FILE *tapout_fd = NULL;
int is_outfile = 0;
@@ -960,9 +960,19 @@ int OpenUart() {
#endif
tcgetattr(serial_fd, &oldtio); /* save current port settings */
- bzero(&newtio, sizeof (newtio));
+ // bzero(&newtio, sizeof (newtio));
+ memset(&newtio, 0x00, sizeof(newtio));
cfmakeraw(&newtio);
switch (baud_rate){
+ case 921600:
+ newtio.c_cflag = B921600;
+ break;
+ case 460800:
+ newtio.c_cflag = B460800;
+ break;
+ case 230400:
+ newtio.c_cflag = B230400;
+ break;
case 115200:
newtio.c_cflag = B115200;
break;
@@ -989,8 +999,8 @@ int OpenUart() {
break;
default:
baud_rate = 38400;
- newtio.c_cflag = B38400;
- break;
+ newtio.c_cflag = B38400;
+ break;
}
cfsetospeed(&newtio, baud_rate);
cfsetispeed(&newtio, baud_rate); // set ispeed same as ospeed (see POSIX)
@@ -1003,10 +1013,9 @@ int OpenUart() {
}
#else
if (is_flow_control_hw) {
- // standard CTS/RTS flow control
+ // standard CTS/RTS flow control for old .sercp protocol
newtio.c_cflag |= CS8 | CLOCAL | CREAD | CRTSCTS;
} else {
- // usefull for eLeMeNt ZX and machines or serial port without CTS/RTS wires
newtio.c_cflag |= CS8 | CLOCAL | CREAD;
}
#endif
@@ -1031,7 +1040,6 @@ int main(int argc, char** argv, char** env)
width = GetTerminalWidth();
ParseCfg();
if (argc < 2) {
- // printf("You must specify the Serial device and file\n");
usage();
exit(1);
}