Skip to content

Instantly share code, notes, and snippets.

@rvalles
Last active October 17, 2020 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvalles/0a7b076810470e8e4e2e0f1662eb70da to your computer and use it in GitHub Desktop.
Save rvalles/0a7b076810470e8e4e2e0f1662eb70da to your computer and use it in GitHub Desktop.
Make libticables2 work (on linux) with dbus-behind-uart-on-ttyUSB bridges like dbus_ti_link_uart_verilog. Change baudrate to 57600.
diff --unified --text libticables2-1.3.5/src/linux/detect.c libticables2-1.3.5-fpga/src/linux/detect.c
--- libticables2-1.3.5/src/linux/detect.c 2016-04-04 14:59:39.000000000 +0900
+++ libticables2-1.3.5-fpga/src/linux/detect.c 2020-10-09 16:38:56.564237490 +0900
@@ -331,7 +331,7 @@
}
serinfo.reserved_char[0] = 0;
- if (ioctl(fd, TIOCGSERIAL, &serinfo) < 0)
+ /*if (ioctl(fd, TIOCGSERIAL, &serinfo) < 0)
{
ticables_warning(_("Error running TIOCGSERIAL ioctl on device %s - %s"), devname, strerror(errno));
close(fd);
@@ -343,7 +343,7 @@
ticables_info(_(" is useable: no"));
close(fd);
return ERR_TTDEV;
- }
+ }*/
ticables_info(_(" is useable: yes"));
close(fd);
diff --unified --text libticables2-1.3.5/src/linux/link_gry.c libticables2-1.3.5-fpga/src/linux/link_gry.c
--- libticables2-1.3.5/src/linux/link_gry.c 2016-04-04 14:59:39.000000000 +0900
+++ libticables2-1.3.5-fpga/src/linux/link_gry.c 2020-10-09 04:32:05.370715795 +0900
@@ -55,7 +55,7 @@
#define DEVNAME "cuad"
#endif
#else
-#define DEVNAME "ttyS"
+#define DEVNAME "ttyACM"
#endif
static int gry_prepare(CableHandle *h)
@@ -135,8 +135,8 @@
termset->c_cc[VMIN] = 0;
termset->c_cc[VTIME] = h->timeout;
- cfsetispeed(termset, B9600);
- cfsetospeed(termset, B9600);
+ cfsetispeed(termset, B57600);
+ cfsetospeed(termset, B57600);
tcsetattr(dev_fd, TCSANOW, termset);
if (tcflush(dev_fd, TCIOFLUSH) == -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment